Class: Pairer::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/pairer/application_controller.rb

Direct Known Subclasses

BoardsController, SessionsController

Instance Method Summary collapse

Instance Method Details

#render_404Object



16
17
18
19
20
21
22
# File 'app/controllers/pairer/application_controller.rb', line 16

def render_404
  if request.format.html?
    render "pairer/exceptions/show", status: 404
  else
    render plain: "404 Not Found", status: 404
  end
end

#robotsObject



7
8
9
10
11
12
13
14
# File 'app/controllers/pairer/application_controller.rb', line 7

def robots
  str = <<~STR
    User-agent: *
    Disallow: /
  STR

  render plain: str, layout: false, content_type: 'text/plain'
end

#signed_in?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
# File 'app/controllers/pairer/application_controller.rb', line 24

def signed_in?
  if session[:pairer_current_org_id].present?
    Pairer.config.allowed_org_ids.collect(&:downcase).include?(session[:pairer_current_org_id].downcase)
  end
end