Fix uninitialized constant selected_event error
This commit is contained in:
parent
f38b755e62
commit
f2af6188a1
2 changed files with 7 additions and 5 deletions
|
|
@ -3,15 +3,12 @@ class SchedulesController < ApplicationController
|
|||
before_action :respond_to_options
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
before_action :presence_of_selected_schedule
|
||||
load_and_authorize_resource :selected_schedule, through: :program, singleton: true
|
||||
|
||||
def show
|
||||
@rooms = @conference.venue.rooms if @conference.venue
|
||||
schedules = @program.selected_event_schedules
|
||||
unless schedules
|
||||
redirect_to events_conference_schedule_path(@conference.short_title)
|
||||
end
|
||||
|
||||
@events_xml = schedules.map(&:event).group_by{ |event| event.time.to_date } if schedules
|
||||
@dates = @conference.start_date..@conference.end_date
|
||||
@step_minutes = @program.schedule_interval.minutes
|
||||
|
|
@ -49,4 +46,9 @@ class SchedulesController < ApplicationController
|
|||
format.html { head :ok }
|
||||
end if request.options?
|
||||
end
|
||||
|
||||
def presence_of_selected_schedule
|
||||
return if @program.selected_event_schedules
|
||||
redirect_to root_path, notice: 'Program is yet to be scheduled.'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue