before_action :check_database_writable, :only => [:create, :update, :destroy]
before_action :check_api_readable, :only => [:show, :data]
before_action :check_api_writable, :only => [:create, :update, :destroy]
- before_action :offline_redirect, :only => [:create, :destroy, :data]
+ before_action :offline_error, :only => [:create, :destroy, :data]
around_action :api_call_handle_error
def show
trace
end
- def offline_redirect
- redirect_to :action => :offline if Settings.status == "gpx_offline"
+ def offline_error
+ report_error "GPX files offline for maintenance", :service_unavailable
end
end
end
end
def new
+ logger.info "new"
@title = t ".upload_trace"
@trace = Trace.new(:visibility => default_visibility)
end
end
def offline_redirect
- redirect_to :action => :offline if Settings.status == "gpx_offline"
+ logger.info "offline_redirect status is #{Settings.status}"
+ render :action => :offline if Settings.status == "gpx_offline"
end
def default_visibility