app/controllers/bus_schedules_controller.rb
# create dummy schedule articles that show lecture days
# params are base_since and base_till for virtual bus_schedule
create dummy schedule articles that show lecture days
params are base_since and base_till for virtual bus_schedule
create dummy schedule articles that show lecture days params are base_since and base_till for virtual bus_schedule
def create_lecture_days
    receiver = BusSchedule.new(params["bus_schedule"]) 
    list_of_lecture_day_schedules = BusSchedule.find :all,
                                            :scope => :self, 
                                            :assert_time => (receiver.since..receiver.till),
                                            :select => "since, till",
                                            :conditions => "holiday = 'on'"
    n_of_dates = 0                                         
    list_of_lecture_day_schedules.each do |sch|
      start_date, end_date = sch.since, sch.till
      while start_date < end_date do 
        Article.create_lecture_day_article(start_date)
        n_of_dates += 1
        start_date += 1.day
      end
    end
    render :update do |page|
      page.replace_html "set_lecture_days", (n_of_dates > 0 ? "#{n_of_dates}日分の授業日を設定しました．" : "授業日はありませんでした．")
    end
  end
def create_lecture_days receiver = BusSchedule . new ( params [ "bus_schedule" ] ) list_of_lecture_day_schedules = BusSchedule . find :all , :scope => :self , :assert_time => ( receiver . since .. receiver . till ) , :select => "since, till" , :conditions => "holiday = 'on'" n_of_dates = 0 list_of_lecture_day_schedules . each do | sch | start_date , end_date = sch . since , sch . till while start_date < end_date do Article . create_lecture_day_article ( start_date ) n_of_dates += 1 start_date += 1 . day end end render :update do | page | page . replace_html "set_lecture_days" , ( n_of_dates > 0 ? "#{n_of_dates}日分の授業日を設定しました．" : "授業日はありませんでした．") end end
create dummy schedule articles that show lecture days
params are base_since and base_till for virtual bus_schedule
create dummy schedule articles that show lecture days params are base_since and base_till for virtual bus_schedule