Class: SpeedupDashboard::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- SpeedupDashboard::ApplicationController
show all
- Defined in:
- app/controllers/speedup_dashboard/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#authorize_server ⇒ Object
14
15
16
17
18
|
# File 'app/controllers/speedup_dashboard/application_controller.rb', line 14
def authorize_server
unless set_server
return render_403
end
end
|
#find_optional_server ⇒ Object
20
21
22
|
# File 'app/controllers/speedup_dashboard/application_controller.rb', line 20
def find_optional_server
@server = Server.find_by(id: params[:server_id])
end
|
#render_403 ⇒ Object
10
11
12
|
# File 'app/controllers/speedup_dashboard/application_controller.rb', line 10
def render_403
render_error(403)
end
|
#render_error(status, message = nil) ⇒ Object
4
5
6
7
8
|
# File 'app/controllers/speedup_dashboard/application_controller.rb', line 4
def render_error(status, message=nil)
@message = message
render 'speedup_dashboard/common/error', status: status
false
end
|