Check that in your controller code, make sure you use
work_object.work_sections.find()
On Nov 22, 1:45 am, "Rich Vázquez"
<rich.vazq...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have a nested restful resource working
>
> map.resources :works do |work|
> work.resources :work_sections
> end
>
> producing a url like:
> /works/2/work_sections/1
>
> I''d like to do two things with the URL, but am not sure where to
start.
>
> 1) I''d like to restrict the work_section from displaying if the
work_id
> isn''t legit.
> Right now /works/2/work_sections/1 will pull up work_section_id 1 even if
it
> is associated with work_id 1 (contrary to the url)
>
> 2) Make it so that the work_section number in the URL is the :position (as
> opposed to :id) for the work_section which is an acts_as_list child of
work.
> I want to avoid ending up with a url like:
/works/223/work_sections/12838
>
> I''m pretty sure accomplishing #2 will include my want for #1.
>
> Is there an example or particular concept I need to look to research how to
> do this type of routing?
>
> --
> --
> Rich Vázquez, CISSP, CISA
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---