Does anyone have a link to where they changed the routing behavior in
edge rails with in the last 3 weeks? Or can give a brief overview of the
changes?
Seems for example the below went from:
messages: GET /:user_id/messages/
{:action=>"index", :controller=>"messages"}
To this:
user_messages: GET /:user_id/messages/
{:controller=>"messages", :action=>"index"}
This happened between revision 6518 and revision 6654 in edge rails.
Route is defined as:
map.resources :users do |user|
user.resources :messages, :path_prefix => '':user_id''
end
Thanks
- John
--
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
-~----------~----~----~----~------~----~------~--~---
> user_messages: GET /:user_id/messages/ > {:controller=>"messages", :action=>"index"} > > This happened between revision 6518 and revision 6654 in edge rails. > > Route is defined as: > > map.resources :users do |user| > user.resources :messages, :path_prefix => '':user_id'' > endThis is done to prevent namespace classes. If you wish to get the old behavior, you can do :name_prefix => nil. The preferred way to do what you''re doing is now: map.resources :users, :has_many => :messages --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>> Route is defined as: >> >> map.resources :users do |user| >> user.resources :messages, :path_prefix => '':user_id'' >> end > > This is done to prevent namespace classes. If you wish to get the old > behavior, you can do :name_prefix => nil. > > The preferred way to do what you''re doing is now: > > map.resources :users, :has_many => :messagesAhh, thanks, I see it here now: http://dev.rubyonrails.org/changeset/6588 Can you still specify a :path_prefix with the new way (has_many)? For example if I wanted the prefix to be :user_login? I have not fixed all the routes yet to test this. Thank you, - John -- 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 -~----------~----~----~----~------~----~------~--~---
> > map.resources :users, :has_many => :messages > > Ahh, thanks, I see it here now:http://dev.rubyonrails.org/changeset/6588 > > Can you still specify a :path_prefix with the new way (has_many)?No. If you want to use options outside of the convention, you''ll still need to work with a block. The block will remain in place for those (presumably rare) instances. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> The preferred way to do what you''re doing is now: > > map.resources :users, :has_many => :messagesI am digging on this syntax. More terse and make sense in the context of Rails/ActiveRecord. I did get tripped up a bit by the changing of the _url and _path methods. http://tuples.us/2007/05/02/changes-to-nested-resource-routes/ Jordan -- 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 -~----------~----~----~----~------~----~------~--~---