form_for with nested resources expects different path

12 views
Skip to first unread message

Everton Cardoso

unread,
Apr 18, 2012, 1:23:07 PM4/18/12
to rubyonra...@googlegroups.com

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

Reply all
Reply to author
Forward
0 new messages