Class: ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ApplicationController
- Includes:
- Pundit
- Defined in:
- app/controllers/application_controller.rb
Overview
Base controller, all other controllers inherit. Pundit controller for application policy
Direct Known Subclasses
GearsController, HavensController, HunterBackstoriesController, HuntersController, HuntersImprovementsController, ImprovementsController, MovesController, PlaybooksController, RatingsController
Instance Method Summary collapse
Instance Method Details
#check_for_mobile ⇒ Object
12 13 14 |
# File 'app/controllers/application_controller.rb', line 12 def check_for_mobile session[:mobile_override] = params[:mobile] if params[:mobile] end |
#mobile_device? ⇒ Boolean
16 17 18 19 20 21 22 23 |
# File 'app/controllers/application_controller.rb', line 16 def mobile_device? if session[:mobile_override] session[:mobile_override] == '1' else # Season this regexp to taste. I prefer to treat iPad as non-mobile. (request.user_agent =~ /(Mobile|webOS)/) end end |