Class: ApplicationController
- Defined in:
- lib/picolena/templates/app/controllers/application.rb
Overview
ApplicationController just checks every incoming request according to the remote IP address.
The request is sent to DocumentsController only if the IP is included in the white list. Otherwise, it returns “Access denied” 403.
Direct Known Subclasses
Instance Method Summary collapse
-
#access_denied ⇒ Object
Returns 403 status in case of an unknown remote IP address.
-
#unknown_request ⇒ Object
Redirects to documents_url in case route hasn’t been recognised.
Instance Method Details
#access_denied ⇒ Object
Returns 403 status in case of an unknown remote IP address
11 12 13 |
# File 'lib/picolena/templates/app/controllers/application.rb', line 11 def access_denied render :text=>"Access denied", :status => 403 end |
#unknown_request ⇒ Object
Redirects to documents_url in case route hasn’t been recognised
16 17 18 19 |
# File 'lib/picolena/templates/app/controllers/application.rb', line 16 def unknown_request flash[:warning]="Unknown URL" redirect_to documents_url end |