Class: Admin::EntriesController

Inherits:
AdminController show all
Defined in:
app/controllers/admin/entries_controller.rb

Instance Method Summary collapse

Methods inherited from SlicesController

should_raise_exceptions?

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/admin/entries_controller.rb', line 6

def index
  @page = Page.find_by_id! params[:page_id]

  respond_to do |format|
    format.html do
      @columns = entry_presenter_class.columns
      @options = {
        sort_field: sort_field,
        sort_direction: sort_direction
      }
    end
    format.json do
      render json: fetch_entries.as_json
    end
  end
end