Is there a simple way of directing all requests to a particular controller to resolve to a single action? I was thinking that this might be a useful way to redirect to a "site down for maintenance" page rather than using apache''s mod_rewrite. -- 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 -~----------~----~----~----~------~----~------~--~---
see api docs for "Route Globbing":
http://api.rubyonrails.org/classes/ActionController/Routing.html
e.g., make a ''default'' controller, and in your routes.rb, make
this
the last route:
# send everything to ''default'' controller
map.connect ''*path'',
:controller => ''default'',
:action => ''index''
On May 29, 6:17 am, Milo Thurston
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Is there a simple way of directing all requests to a particular
> controller to resolve to a single action?
> I was thinking that this might be a useful way to redirect to a "site
> down for maintenance" page rather than using apache''s
mod_rewrite.
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:> see api docs for "Route Globbing": > http://api.rubyonrails.org/classes/ActionController/Routing.htmlGreat, thanks. Adding that first in routes.rb does exactly what I need and has the advantage of working without apache. -- 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 -~----------~----~----~----~------~----~------~--~---