Rails2. If a route has already been established with "map.resources", is there any way I can add an additional member to it, without over-writing what''s already there? This comes up in two engines-style plugins interacting with each other and with the app itself. -- 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-/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.
Marnen Laibow-Koser
2010-Jul-19 20:00 UTC
Re: add a member to a pre-existing resource-route?
Jonathan Rochkind wrote:> Rails2. If a route has already been established with "map.resources", > is there any way I can add an additional member to it, without > over-writing what''s already there? > > This comes up in two engines-style plugins interacting with each other > and with the app itself.Just define the route as you normally would (with map.connect ). map.resources is not magical; it''s just shorthand for a bunch of map.connect statements. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/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.
Jonathan Rochkind
2010-Jul-19 20:25 UTC
Re: add a member to a pre-existing resource-route?
Marnen Laibow-Koser wrote:> Jonathan Rochkind wrote: >> Rails2. If a route has already been established with "map.resources", >> is there any way I can add an additional member to it, without >> over-writing what''s already there? > > Just define the route as you normally would (with map.connect ). > map.resources is not magical; it''s just shorthand for a bunch of > map.connect statements.Ah, i was worried that my second map.resources would ''over-ride'' certain things from the first one. But it looks like it doesn''t. If you call map.resources once with certain :members, and then call it again with another :member... it LOOKS like indeed all the aggregated members are now there. Cool. Thanks. -- 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-/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.
Marnen Laibow-Koser
2010-Jul-19 21:44 UTC
Re: add a member to a pre-existing resource-route?
Jonathan Rochkind wrote:> Marnen Laibow-Koser wrote: >> Jonathan Rochkind wrote: >>> Rails2. If a route has already been established with "map.resources", >>> is there any way I can add an additional member to it, without >>> over-writing what''s already there? >> >> Just define the route as you normally would (with map.connect ). >> map.resources is not magical; it''s just shorthand for a bunch of >> map.connect statements. > > Ah, i was worried that my second map.resources would ''over-ride'' certain > things from the first one. But it looks like it doesn''t. If you call > map.resources once with certain :members, and then call it again with > another :member... it LOOKS like indeed all the aggregated members are > now there. Cool. Thanks.Interesting to know. I''d tend to only call map.resources once and then use map.connect, but it''s good to know that it works either way. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/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.