Hi all I have a model called "party_organisator" connected to its controller PartyOrganisatorsController. I''m switching to RESTful routes, so I''m having map.resources :party_organisators My "problem" is: I have to point my browser to localhost:3000/party_organisators to access it, but I''d like to access it using localhost:3000/parties/organisators How can I do this? I''m a bit unsure with the options I can use... :-/ Thanks Josh -- 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 -~----------~----~----~----~------~----~------~--~---
I think you might try: map.connect ''party/ organisator'', :controller=>''party_organisator'', :action=>''index'' (Look at the comments at the top of your routes.rb file.) On Dec 18, 4:08 pm, Joshua Muheim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all > > I have a model called "party_organisator" connected to its controller > PartyOrganisatorsController. > > I''m switching to RESTful routes, so I''m having > > map.resources :party_organisators > > My "problem" is: I have to point my browser to > > localhost:3000/party_organisators > > to access it, but I''d like to access it using > > localhost:3000/parties/organisators > > How can I do this? I''m a bit unsure with the options I can use... :-/ > > Thanks > Josh > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Paul Lynch wrote:> I think you might try: > map.connect ''party/ > organisator'', :controller=>''party_organisator'', :action=>''index'' > > (Look at the comments at the top of your routes.rb file.) > > On Dec 18, 4:08 pm, Joshua Muheim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>I doubt that this is what I''m looking for - I need map.resources, not map.connect, don''t I?! -- 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 -~----------~----~----~----~------~----~------~--~---
There''s no such word as "organisators", so I''m using organisers. Assuming parties and organisers are two different controllers: map.resources :parties do |party| party.resources :organisers, :name_prefix => "party_" end and the other way map.resources :organisers do |organiser| organiser.resources :parties, :name_prefix => "organiser" end If you''re using Rails 2.0 you should be able to do something like this: map.resources :parties, :has_one => :organiser map.resources :organiser, :has_many => :parties On Dec 19, 2007 8:36 AM, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Paul Lynch wrote: > > I think you might try: > > map.connect ''party/ > > organisator'', :controller=>''party_organisator'', :action=>''index'' > > > > (Look at the comments at the top of your routes.rb file.) > > > > On Dec 18, 4:08 pm, Joshua Muheim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > I doubt that this is what I''m looking for - I need map.resources, not > map.connect, don''t I?! > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---