Class: Tuttle::CancancanController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Tuttle::CancancanController
- Defined in:
- app/controllers/tuttle/cancancan_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/tuttle/cancancan_controller.rb', line 7 def index @cancan_user = current_user || User.new @ability = Ability.new(@cancan_user) @rules = @ability.instance_variable_get('@rules') end |
#rule_tester ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/controllers/tuttle/cancancan_controller.rb', line 13 def rule_tester @models = ActiveRecord::Base.descendants.reject(&:abstract_class) @action = params[:action_name] || 'read' @subject = find_subject(params[:subject_class], params[:subject_id]) @cancan_user = current_user || User.new @ability = Ability.new(@cancan_user) end |