#744 ✓resolved
dsc68

<after-submit stay-here/> produces invalid URL when used in a show or update page

Reported by dsc68 | June 21st, 2010 @ 04:54 AM | in Hobo 1.3 (Rails 3)

I have a application with three models A, B & C.

In model A.rb,

has_many :B, :accessible = true
has_many :C, :accessible = true

Controllers for B & C are:

auto_actions :none
auto_actions_for :location, [:create]

A_hints.rb has

children :B, :C

The show page for A displays B as a section with an input form and C as an aside with no input form.

The show page for A has been extended to include an input form for C. As A_hints.rb lists C as the second child, the view_hint for C does not have A as the parent (I'm assuming this is intentional). Creating a new C results in the user being returned to the home page.

Adding a tag to the input form for C should return the user to the show page for A. Instead it returns a page not found error with the URL "http://localhost/As/show&quot; ie missing the details of the specific A record.

Looking through the code in model_controller.rb:

destination_after_submit calls url_for_page_path if after-submit is stay-here.

def url_for_page_path
  controller, view = Controller.controller_and_view_for(params[:page_path])
  url_for :controller => controller, :action => view
end

:page_path is "As/show". As a result, url_for returns "http://localhost/As/show&quot; as the URL without the id for the specific A record, which is invalid. url_for_page_path does not work correctly for show or update pages.

Comments and changes to this ticket

  • Matt Jones

    Matt Jones September 14th, 2011 @ 10:48 PM

    • State changed from “new” to “open”
    • Milestone set to Hobo 1.3 (Rails 3)
    • Milestone order changed from “0” to “0”

    I think this is fixed (we set page_path differently now). Will investigate.

  • Matt Jones

    Matt Jones September 26th, 2011 @ 01:21 AM

    • State changed from “open” to “resolved”

    On further review, this is definitely no longer an issue - page_path now contains the needed data.

    Please reopen if this isn't working in 1.3.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages