How can I create a Rails 3 route that will match all requests and direct to one resource / page?

后端 未结 4 1596
粉色の甜心
粉色の甜心 2021-02-07 03:50

I have a rails app (Rails 3.0) that I need to temporarily take out of service. While this is in effect, I want to create a new route that will direct all requests to a single pi

4条回答
  •  爱一瞬间的悲伤
    2021-02-07 04:26

    Where in "routes.rb" is this line located?

    To have priority over other routes, it has to be placed first.

    As an alternative, you can look into this: http://onehub.com/blog/posts/rails-maintenance-pages-done-right/

    Or this: Rails: admin-only maintenance mode

提交回复
热议问题