Module: SimpleCrudify::CrudifyDynamicResource Private

Defined in:
lib/simple_crudify/crudify_dynamic_resource.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



5
6
7
8
9
10
11
12
# File 'lib/simple_crudify/crudify_dynamic_resource.rb', line 5

def create
  @resource = model_klass.new(resource_params)
  @resource.save

  respond_to do |format|
    format.js { render layout: false }
  end
end

#destroyObject

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



23
24
25
26
27
28
29
30
# File 'lib/simple_crudify/crudify_dynamic_resource.rb', line 23

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

  respond_to do |format|
    format.js { render layout: false }
  end
end

#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



14
15
16
17
18
19
20
21
# File 'lib/simple_crudify/crudify_dynamic_resource.rb', line 14

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

  respond_to do |format|
    format.js { render layout: false }
  end
end