Module: SimpleCrudify::CrudActions::Create 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

#createObject

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



36
37
38
39
40
41
42
43
44
# File 'lib/simple_crudify/crud_actions.rb', line 36

def create
  @resource = model_klass.new(resource_params)

  if @resource.save
    redirect_to after_create_path, notice: controller_notice(action_name)
  else
    render template: template_path(:new)
  end
end