I''m having an issue with the record identification. If I have a
:has_one
resource relationship mapped in routes.rb I can properly reference that
in form_for with:
for example: @user.id = 2, @user.profile.id = 1
form_for ( [:user, @user.profile])
and it will create the proper route:
.../user/2/profile/
and use @user.id for the :user_id
however if I try the same convention in link_to:
link_to "link" [:user, @user.profile]
the format of the URL is different:
.../user/1/profile/
It will use @user.profile.id for the :user_id instead. Any thoughts?
I am mapping the resource this way:
map.resources :users, :has_one => :profile
Any thoughts?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---