Everton Cardoso
2012-Apr-18 17:23 UTC
form_for with nested resources expects different path
Hi guys, I have a problem with form_for helper method. Scenario: My models ---------------- Org::Organization and Org::Member routes.rb -------------- namespace :org do resources :organizations do resources :members end end so, Rails creates helper methods like this: org_organization_members_path, when i tried use the form_for: form_for [@organization, @member ] do ... end it occurs the error: ActionView::Template::Error: undefined method `org_organization_org_members_path'' for #<#<Class:0x007ff90b3645c8>:0x007ff90b3c11b0> Why rails is defining the helper method like org_organization_members_path and form_for is expecting org_organization_org_members_path ? I''m actually using rails 3.2.1. Thanks, Everton Cardoso -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/rR4zLHZQyGYJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Everton Cardoso
2012-Apr-18 21:00 UTC
form_for with nested resources expects different path
Hi guys, I have a problem with form_for helper method. Scenario: My models ---------------- Org::Organization and Org::Member routes.rb -------------- namespace :org do resources :organizations do resources :members end end so, Rails creates helper methods like this: org_organization_members_path, when i tried use the form_for: form_for [@organization, @member ] do ... end it occurs the error: ActionView::Template::Error: undefined method `org_organization_org_members_path'' for #<#<Class:0x007ff90b3645c8>:0x007ff90b3c11b0> Why rails is defining the helper method like org_organization_members_path and form_for is expecting org_organization_org_members_path ? I''m actually using rails 3.2.1. Thanks, Everton Cardoso -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dave Dolan
2013-Jan-02 15:55 UTC
Re: form_for with nested resources expects different path
I''m having this same problem. did you ever get this resolved? On Wednesday, April 18, 2012 1:23:07 PM UTC-4, Everton Cardoso wrote:> > Hi guys, I have a problem with form_for helper method. > > > Scenario: > > My models > > ---------------- > > Org::Organization and Org::Member > > > routes.rb > > -------------- > > namespace :org do > > resources :organizations do > > resources :members > > end > > end > > > so, Rails creates helper methods like this: org_organization_members_path, > when i tried use the form_for: > > > form_for [@organization, @member ] do > > ... > > end > > > it occurs the error: > > ActionView::Template::Error: > > undefined method `org_organization_org_members_path'' for > #<#<Class:0x007ff90b3645c8>:0x007ff90b3c11b0> > > > Why rails is defining the helper method like org_organization_members_path > and form_for is expecting org_organization_org_members_path ? > > > I''m actually using rails 3.2.1. > > > > Thanks, > > Everton Cardoso >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/r7BOGGuQv28J. For more options, visit https://groups.google.com/groups/opt_out.