Re: [Rails] Telling users there is maintenance happening

2018-02-22 Thread Walter Lee Davis
Rails routes are built when the app starts (or if you're under a lot of traffic, if you fork a new Apache process). Rails is a long-running process, and it does not reload at each request. You would have to restart the server to have a change in routes make a difference. If you've deployed with

Re: [Rails] Telling users there is maintenance happening

2018-02-22 Thread Ralph Shnelvar
So I tried this: Rails.application.routes.draw do if File.exist?('/home/real-estate-data-mining/MaintenanceNow') get '*', redirect_to: '/maintenance.html' else resources :experiments resources :articles end end but it doesn't work I do see that there is a Rails.application.rel

Re: [Rails] Telling users there is maintenance happening

2018-02-22 Thread Walter Lee Davis
I have used this route in the past to do this in an informal manner: get '*', redirect_to: '/maintenance.html' ...and put that at or near the top of the routes file. Comment it out when you want to run normally. The Gem approach will do a more thorough job, catching post and patch and everythi

Re: [Rails] Telling users there is maintenance happening; Two servers

2018-02-21 Thread Hassan Schroeder
On Wed, Feb 21, 2018 at 5:10 PM, Ralph Shnelvar wrote: > Since Server X and Server Y are - more or less - identically configured, > what is the best way for me to put up an "Under maintenance" web page? One possibility: https://github.com/capistrano/maintenance At the least you might get some i