Method: ActiveAdmin::ResourceController::DataAccess#update_resource

Defined in:
lib/active_admin/resource_controller/data_access.rb

#update_resource(object, attributes) ⇒ void (protected)

This method returns an undefined value.

Update an object with the given attributes. Also calls the appropriate callbacks for update action.

Parameters:

  • object (ActiveRecord::Base)

    The instance to update

  • attributes (Array)

    An array with the attributes in the first position and the Active Record “role” in the second. The role may be set to nil.



169
170
171
172
173
174
175
# File 'lib/active_admin/resource_controller/data_access.rb', line 169

def update_resource(object, attributes)
  object = assign_attributes(object, attributes)

  run_update_callbacks object do
    save_resource(object)
  end
end