Class: Admin::ManagerController

Inherits:
BaseController
  • Object
show all
Includes:
AbAdmin::Controllers::Tree
Defined in:
app/controllers/admin/manager_controller.rb

Instance Method Summary collapse

Methods included from AbAdmin::Controllers::Tree

#rebuild

Instance Method Details

#custom_actionObject



8
9
10
11
12
13
14
# File 'app/controllers/admin/manager_controller.rb', line 8

def custom_action
  custom_action = manager.custom_action_for(params[:custom_action], self)
  if custom_action.options[:method] && custom_action.options[:method] != request.method_symbol
    raise ActionController::RoutingError.new("AbAdmin custom action #{custom_action.options[:method].to_s.upcase} #{params[:custom_action]} not allowed for #{request.method_symbol} method")
  end
  instance_exec(&custom_action.data)
end