Module: SimpleCrudify::CrudActions::Update Private

Defined in:
lib/simple_crudify/crud_actions.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#updateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



60
61
62
63
64
65
66
67
68
# File 'lib/simple_crudify/crud_actions.rb', line 60

def update
  @resource = ResourceHelper.resource(model_klass, params[:id])

  if @resource.update(resource_params)
    redirect_to after_update_path, notice: controller_notice(action_name)
  else
    render template: template_path(:edit)
  end
end