diff options
| author | Xinhui | 2017-05-23 11:54:05 +0200 |
|---|---|---|
| committer | Xinhui | 2017-05-23 11:54:11 +0200 |
| commit | f47654ea82d1e418f99df107ed899664c3c6ba2e (patch) | |
| tree | 019a718a20cdd5201b3ffeb12682a3ea5ef03622 /app | |
| parent | 7eb6dab3d9a1fcbc374b522d840f8a6829f83051 (diff) | |
| download | chouette-core-f47654ea82d1e418f99df107ed899664c3c6ba2e.tar.bz2 | |
Fix create time_table with calendar association
Refs #2347
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 2 | ||||
| -rw-r--r-- | app/views/time_tables/_form.html.slim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index dcf8f3e5e..5c4552afb 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -43,7 +43,7 @@ class TimeTablesController < ChouetteController if calendar calendar.dates.each_with_index do |date, i| - @time_table.dates << Chouette::TimeTableDate.new(date: date, position: i) + @time_table.dates << Chouette::TimeTableDate.new(date: date, position: i, in_out: true) end calendar.date_ranges.each_with_index do |date_range, i| @time_table.periods << Chouette::TimeTablePeriod.new(period_start: date_range.begin, period_end: date_range.end, position: i) diff --git a/app/views/time_tables/_form.html.slim b/app/views/time_tables/_form.html.slim index 196682823..d4e1d838e 100644 --- a/app/views/time_tables/_form.html.slim +++ b/app/views/time_tables/_form.html.slim @@ -5,7 +5,7 @@ = form.input :comment, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.time_table.comment")} - if @time_table.new_record? && !@time_table.created_from - = form.input :calendar, as: :select, collection: current_organisation.calendars + = form.input :calendar_id, as: :select, collection: current_organisation.calendars - if @time_table.created_from = form.input :created_from, disabled: true, input_html: { value: @time_table.created_from.comment } |
