Class: Pageflow::Editor::EntriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pageflow/editor/entries_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



10
11
12
13
# File 'app/controllers/pageflow/editor/entries_controller.rb', line 10

def index
  @entries = DraftEntry.accessible_by(current_ability, :use_files)
  respond_with(@entries)
end

#seedObject



15
16
17
18
19
20
# File 'app/controllers/pageflow/editor/entries_controller.rb', line 15

def seed
  @entry = DraftEntry.find(params[:id])
  authorize!(:edit, @entry.to_model)

  @entry_config = Pageflow.config_for(@entry)
end

#showObject



22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/pageflow/editor/entries_controller.rb', line 22

def show
  @entry = DraftEntry.find(params[:id])
  authorize!(:edit, @entry.to_model)

  @entry_config = Pageflow.config_for(@entry)

  respond_to do |format|
    format.html
    format.json
  end
end

#updateObject



34
35
36
37
38
39
40
41
# File 'app/controllers/pageflow/editor/entries_controller.rb', line 34

def update
  @entry = DraftEntry.find(params[:id])

  authorize!(:update, @entry.to_model)
  @entry.update_meta_data!(entry_params)

  head(:no_content)
end