Method: ActiveAdmin::ResourceController::DataAccess#resource
- Defined in:
- lib/active_admin/resource_controller/data_access.rb
#resource ⇒ ActiveRecord::Base (protected)
Retrieve, memoize and authorize a resource based on params. The actual work of finding the resource is done in #find_resource.
This method is used on all the member actions:
* show
* edit
* update
* destroy
88 89 90 91 92 93 94 95 96 |
# File 'lib/active_admin/resource_controller/data_access.rb', line 88 def resource get_resource_ivar || begin resource = find_resource resource = apply_decorations(resource) resource set_resource_ivar resource end end |