diff options
| author | Zog | 2018-02-27 08:26:40 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-03-01 18:20:56 -0800 |
| commit | ab396d083c4e7197a20412b0148a7ba1012d64f9 (patch) | |
| tree | d2742c096b30b80a2aa454dd8e77ad92cfe76637 | |
| parent | 726e13de02e60c825f224aee62b8ea166740dd67 (diff) | |
| download | chouette-core-ab396d083c4e7197a20412b0148a7ba1012d64f9.tar.bz2 | |
Refs #5940; Add missing flash after Calendar creation
| -rw-r--r-- | app/controllers/calendars_controller.rb | 11 | ||||
| -rw-r--r-- | app/views/calendars/_form_advanced.html.slim | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 75d4cbd09..cc7570d65 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -31,10 +31,11 @@ class CalendarsController < ChouetteController end def create - create! do - if @calendar.valid? && has_feature?('application_days_on_calendars') - redirect_to([:edit, @calendar]) - return + create! do |success, failure| + if has_feature?('application_days_on_calendars') + success.html do + redirect_to([:edit, @workgroup, @calendar]) + end end end end @@ -125,4 +126,4 @@ class CalendarsController < ChouetteController scope end -end
\ No newline at end of file +end diff --git a/app/views/calendars/_form_advanced.html.slim b/app/views/calendars/_form_advanced.html.slim index e796e2e36..aa4fd4e40 100644 --- a/app/views/calendars/_form_advanced.html.slim +++ b/app/views/calendars/_form_advanced.html.slim @@ -3,6 +3,6 @@ = javascript_tag do | window.actionType = "#{raw params[:action]}"; // | window.I18n = #{(I18n.backend.send(:translations)[I18n.locale].to_json).html_safe}; - | window.timetablesUrl = "#{calendar_url(@calendar).html_safe}"; + | window.timetablesUrl = "#{workgroup_calendar_url(@workgroup, @calendar).html_safe}"; = javascript_pack_tag 'calendars/edit.js' |
