mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add routes and controller to scan Qr code
Added TicketScanning controller and routes to scan qr code on PhysicalTickets. Added test for the same
This commit is contained in:
parent
e2bad46d00
commit
1391668c0f
4 changed files with 85 additions and 0 deletions
16
app/controllers/admin/ticket_scannings_controller.rb
Normal file
16
app/controllers/admin/ticket_scannings_controller.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue