osem-fcy/app/controllers/tickets_controller.rb
2018-04-04 10:28:10 -07:00

15 lines
499 B
Ruby

# frozen_string_literal: true
class TicketsController < ApplicationController
before_action :authenticate_user!
load_resource :conference, find_by: :short_title
load_resource :ticket, through: :conference
authorize_resource :conference_registrations, class: Registration
before_action :check_load_resource, only: :index
def index; end
def check_load_resource
redirect_to root_path, notice: "There are no tickets available for #{@conference.title}!" if @tickets.empty?
end
end