Hi, I''ve been playing with routes and with Jamis Buck''s plugin
for host
based routing (http://svn.jamisbuck.org/rails-plugins/routing_tricks/).
Here''s what I have in routes.rb:
1 map.connect '''', :conditions => { :host =>
/www.example.(com|co.uk)/ },
2 :controller => "example/portal"
3
4 map.connect '':controller/:action/:id'',
5 :conditions => { :host =>
/www.example.(com|co.uk)/ },
6 :controller => "example/:controller"
7
8 # Default root
9 map.connect '''', :controller => "portal"
0
1 # Install the default route as the lowest priority.
2 map.connect '':controller/:action/:id.:format''
3 map.connect '':controller/:action/:id''
4
The first route at lines 1-2 fires on a request from
"http://www.example.com", causing the file
"controllers/example/portal_controller.rb" to be used.
Any other domain is picked up by line 13 and causes
controllers/portal_controller.rb" to be used.
The second route at lines 4-6 is supposed to fire on requests like
"http://www.example.com/portal" but all I get here is
"controllers/portal_controller.rb" being used (I suspect this is via
the
route at line 13).
I need my route at line 4-6 to respond to requests for
"http://www.example.com/controller/action/id and fire
"controllers/example/controller" ?
I am pretty sure the code on line 6 is wrong but have no idea what it
should be to make this work.
I want to handle overlays for several different domains.
Many 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-/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
-~----------~----~----~----~------~----~------~--~---