Fix Stellas review gripes
This commit is contained in:
parent
d13efa5f52
commit
c6bd65deaa
6 changed files with 51 additions and 46 deletions
|
|
@ -1,8 +1,15 @@
|
|||
class TicketsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_resource :tickets, class: Ticket
|
||||
load_resource :ticket, through: :conference
|
||||
authorize_resource :conference_registrations, class: Registration
|
||||
before_filter :check_load_resource, only: :index
|
||||
|
||||
def index; end
|
||||
|
||||
def check_load_resource
|
||||
if @tickets.empty?
|
||||
redirect_to root_path, notice: "There are no tickets available for #{@conference.title}!"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue