Class: Pageflow::Editor::EntryPublicationsController

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

Instance Method Summary collapse

Instance Method Details

#checkObject


22
23
24
25
26
27
28
# File 'app/controllers/pageflow/editor/entry_publications_controller.rb', line 22

def check
  entry = Entry.find(params[:entry_id])

  authorize!(:publish, entry)

  @entry_publication = build_entry_publication(entry)
end

#createObject


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/pageflow/editor/entry_publications_controller.rb', line 8

def create
  entry = Entry.find(params[:entry_id])

  authorize!(:publish, entry)
  verify_edit_lock!(entry)

  @entry_publication = build_entry_publication(entry)
  @entry_publication.save!

  render(action: :check)
rescue Quota::ExceededError
  render(action: :check, status: :forbidden)
end