From adb04ab82e4037222958c57abe8a135f9c1276f8 Mon Sep 17 00:00:00 2001 From: differentreality Date: Mon, 29 Jul 2013 02:01:24 +0300 Subject: [PATCH] show current day's schedule --- app/controllers/schedule_controller.rb | 4 ++++ app/views/schedule/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/schedule_controller.rb b/app/controllers/schedule_controller.rb index 8a18f568..177b90c0 100644 --- a/app/controllers/schedule_controller.rb +++ b/app/controllers/schedule_controller.rb @@ -7,6 +7,10 @@ class ScheduleController < ApplicationController @rooms = @conference.rooms @events = @conference.events @dates = @conference.start_date..@conference.end_date + + if @dates === Date.current + @today = Date.current.strftime("%Y-%m-%d") end + end end diff --git a/app/views/schedule/index.html.erb b/app/views/schedule/index.html.erb index 12df1d14..c8a98d09 100644 --- a/app/views/schedule/index.html.erb +++ b/app/views/schedule/index.html.erb @@ -116,7 +116,7 @@ $(function() { if (activeTab.length) { activeTab.tab('show'); } else { - $('.nav-tabs a:first').tab('show'); + $('.nav-tabs a[href=#<%= j @today %>]').tab('show'); } }); });