Merge pull request #1613 from siddhantbajaj/read-qr

Scan QR code.
This commit is contained in:
Ana María Martínez Gómez 2017-08-16 10:05:06 +02:00 committed by GitHub
commit 3f324d4e6f
4 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,16 @@
module Admin
class TicketScanningsController < Admin::BaseController
before_action :authenticate_user!
load_resource :physical_ticket, find_by: :token
# We authorize manually in these actions
skip_authorize_resource only: [:create]
def create
@ticket_scanning = TicketScanning.new(physical_ticket: @physical_ticket)
authorize! :create, @ticket_scanning
@ticket_scanning.save
redirect_to conferences_path,
notice: "Ticket with token #{@physical_ticket.token} successfully scanned."
end
end
end