Class: GacoCms::Admin::FieldGroupsManagerController

Inherits:
BaseController show all
Defined in:
app/controllers/gaco_cms/admin/field_groups_manager_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#upload_file

Instance Method Details

#field_tplObject

Parameters:

  • kind (Hash)

    a customizable set of options



21
22
23
24
# File 'app/controllers/gaco_cms/admin/field_groups_manager_controller.rb', line 21

def field_tpl
  field = Field.new(kind: params[:kind])
  render partial: 'field', locals: { field: field, parent_name: params[:parent_name] }
end

#group_tplObject



15
16
17
18
# File 'app/controllers/gaco_cms/admin/field_groups_manager_controller.rb', line 15

def group_tpl
  @group = FieldGroup.new
  render partial: 'group', locals: { group: @group }
end

#indexObject

Parameters:

  • record_type (Hash)

    a customizable set of options

  • record_id (Hash)

    a customizable set of options

  • reload_frame (Hash)

    a customizable set of options



11
12
13
# File 'app/controllers/gaco_cms/admin/field_groups_manager_controller.rb', line 11

def index
  @groups = @record.field_groups
end

#updateObject



26
27
28
29
30
31
32
# File 'app/controllers/gaco_cms/admin/field_groups_manager_controller.rb', line 26

def update
  if @record.update(groups_params)
    render inline: ''
  else
    render inline: @record.errors.full_messages.join(', ')
  end
end