List Info

Thread: Re: named routes / has_one problem




Re: named routes / has_one problem
user name
2007-12-30 04:05:52
The helper form_for does not work for nested singleton
resource in
Rails 2.0

Given below nested singleton resource profile,
map.resources :users do |user|
    user.resource  :profile
end

<% form_for([user, profile]) do |f| %>
actually expects to get the url from helper
"user_profileS_url ",
instead of "user_profile_url". The latter url
helper is the one
generated by routes.rb.
<% form_for([:user, profile]) do |f| %> generates url like
/user/
profile, which is for named route, not for singleton
resource.

Any idea?

Steven




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails" group.
To post to this group, send email to rubyonrailsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-unsubscribegooglegroups.com
For more options, visit this group at http://gro
ups.google.com/group/rubyonrails
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )