Class: Integral::Backend::ListsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/integral/backend/lists_controller.rb

Overview

List controller

Instance Method Summary collapse

Methods inherited from BaseController

#activities, #activity, #create, #destroy, #edit, #new, #update

Instance Method Details

#duplicateObject

POST /:id/duplicate Duplicate a resource



22
23
24
25
26
# File 'app/controllers/integral/backend/lists_controller.rb', line 22

def duplicate
  super do |cloned_resource|
    cloned_resource.title = "Copy #{@resource.title}"
  end
end

#indexObject

GET / Lists all lists



11
12
13
14
15
16
17
18
# File 'app/controllers/integral/backend/lists_controller.rb', line 11

def index
  respond_to do |format|
    format.html
    format.json do
      render json: { content: render_to_string(partial: 'integral/backend/lists/grid', locals: { grid: @grid }) }
    end
  end
end