Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
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

DocumentsController

Instance Method Summary collapse

Instance Method Details

#access_deniedObject

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_requestObject

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