I know this isn''t all that Rails friendly but is it possible to do catch-all routing so that some value can be passed in as if it were a controller for example http://localhost:3000/ford/thunderbird http://localhost:3000/gm/solstice I know you can do it like this http://localhost:3000/manufacturers/ford/thunderbird http://localhost:3000/manufacturers/gm/solstice but is it possible to skip the controller name? TIA. GP -- 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.connect ":manufacturer_name/:model_name", :controller => "manufactuers", :action => "show" in your controller params[:manufacturer_name] and params[:model_name] should be available On Oct 22, 6:27 pm, Grayson Piercee <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I know this isn''t all that Rails friendly but is it possible to do > catch-all routing so that some value can be passed in as if it were a > controller for example > > http://localhost:3000/ford/thunderbirdhttp://localhost:3000/gm/solstice > > I know you can do it like this > > http://localhost:3000/manufacturers/ford/thunderbirdhttp://localhost:3000/manufacturers/gm/solstice > > but is it possible to skip the controller name? > > TIA. > > GP > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew, Sorry I should have mentioned that I won''t know the manufacturer names ahead of time (in other words, I want to make it data driven). That''s what I meant by catch-all. Andrew Bloom wrote:> map.connect ":manufacturer_name/:model_name", :controller => > "manufactuers", :action => "show" > > in your controller params[:manufacturer_name] and params[:model_name] > should be available > > On Oct 22, 6:27�pm, Grayson Piercee <rails-mailing-l...@andreas-s.net>-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
map.static '':permalink'', :controller => ''pages'', :action => ''show'' or map.connect "*path", :controller => "four_oh_fours" First on is not great and you need to handle 404s in that controller... the second is well an example from a 404 controller BUT it shows the *path example... if you do /bla1/bla2/bla3 that''s what you get in the params... Parameters: {"action"=>"index", "controller"=>"four_oh_fours", "path"=>["bla1", "bla2", "bla3"]} --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---