Get rid of the schedule controller

This commit is contained in:
Henne Vogelsang 2014-11-27 14:31:44 +01:00
parent ebb7d8da2c
commit ce6ed0a8e9
10 changed files with 19 additions and 30 deletions

View file

@ -11,6 +11,18 @@ class ConferenceController < ApplicationController
@keynote_speakers = @conference.keynote_speakers
end
def schedule
@rooms = @conference.rooms
@events = @conference.events
@dates = @conference.start_date..@conference.end_date
if @dates == Date.current
@today = Date.current.strftime('%Y-%m-%d')
else
@today = @conference.start_date.strftime('%Y-%m-%d')
end
end
def gallery_photos
@photos = @conference.photos
render 'photos', formats: [:js]

View file

@ -1,19 +0,0 @@
class ScheduleController < ApplicationController
authorize_resource class: false
layout 'application'
def index
@conference = Conference.
includes(:rooms, events: [:speakers, :track, :event_type]).
where(conferences: { short_title: params[:conference_id] }).first
@rooms = @conference.rooms
@events = @conference.events
@dates = @conference.start_date..@conference.end_date
if @dates == Date.current
@today = Date.current.strftime('%Y-%m-%d')
else
@today = @conference.start_date.strftime('%Y-%m-%d')
end
end
end