Fix Stellas review gripes

This commit is contained in:
Henne Vogelsang 2014-12-09 15:19:01 +01:00
parent d13efa5f52
commit c6bd65deaa
6 changed files with 51 additions and 46 deletions

View file

@ -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