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



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

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
21
22
# 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)
rescue Entry::PasswordMissingError
  head(:bad_request)
end