Module: Challah::Controller::ClassMethods
- Defined in:
- lib/challah/controller.rb
Instance Method Summary collapse
-
#restrict_to_authenticated(options = {}) ⇒ Object
Restrict the current controller to only users that have authenticated.
-
#signin_required(*args) ⇒ Object
(also: #login_required)
Alias for restrict_to_authenticated.
Instance Method Details
#restrict_to_authenticated(options = {}) ⇒ Object
Restrict the current controller to only users that have authenticated. All actions in the controller will be restricted unless otherwise stated. All normal options for a before_action are observed.
31 32 33 34 35 |
# File 'lib/challah/controller.rb', line 31 def restrict_to_authenticated( = {}) before_action() do |controller| controller.send(:signin_required) end end |
#signin_required(*args) ⇒ Object Also known as: login_required
Alias for restrict_to_authenticated
38 39 40 |
# File 'lib/challah/controller.rb', line 38 def signin_required(*args) restrict_to_authenticated(*args) end |