Class: Pageflow::Editor::EncodingConfirmationsController

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

Instance Method Summary collapse

Instance Method Details

#checkObject



20
21
22
23
24
25
# File 'app/controllers/pageflow/editor/encoding_confirmations_controller.rb', line 20

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

  authorize!(:confirm_encoding, entry.to_model)
  @encoding_confirmation = build_encoding_confirmation(entry)
end

#createObject



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

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

  authorize!(:confirm_encoding, entry.to_model)
  @encoding_confirmation = build_encoding_confirmation(entry)
  @encoding_confirmation.save!

  render(json: {})
rescue EncodingConfirmation::QuotaExceededError
  render(action: :check, status: :forbidden)
end