diff options
| author | Xinhui | 2017-10-17 14:54:41 +0200 |
|---|---|---|
| committer | Xinhui | 2017-10-17 14:54:55 +0200 |
| commit | 4bb7669f00b7e6e622f966a11b4c727938838f22 (patch) | |
| tree | c82537270c06b522c61cc5767cff6612d9e430c4 | |
| parent | 58cfec64c621d1c6893280f5ad8793af81573199 (diff) | |
| download | chouette-core-4bb7669f00b7e6e622f966a11b4c727938838f22.tar.bz2 | |
Fix time_tables#index tags form should display searched tags on submit
Refs #4711
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 1 | ||||
| -rw-r--r-- | app/views/time_tables/_filter.html.slim | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index 2d24d5aa6..af74f635f 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -130,7 +130,6 @@ class TimeTablesController < ChouetteController scope = select_time_tables if params[:q] && params[:q]["tag_search"] tags = params[:q]["tag_search"].reject {|c| c.empty?} - params[:q].delete("tag_search") scope = select_time_tables.tagged_with(tags, :any => true) if tags.any? end scope = self.ransack_period_range(scope: scope, error_message: t('referentials.errors.validity_period'), query: :overlapping) diff --git a/app/views/time_tables/_filter.html.slim b/app/views/time_tables/_filter.html.slim index 2672f7dfc..11e9987c4 100644 --- a/app/views/time_tables/_filter.html.slim +++ b/app/views/time_tables/_filter.html.slim @@ -9,7 +9,7 @@ .ffg-row .form-group = f.label Chouette::TimeTable.human_attribute_name(:tag_search), required: false, class: 'control-label' - = f.input :tag_search, as: :tags, collection: Chouette::TimeTable.tags_on(:tags).pluck(:name), label: false, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Indiquez une étiquette...' }, wrapper_html: { class: 'select2ed'}, include_blank: false + = f.input :tag_search, as: :tags, collection: Chouette::TimeTable.tags_on(:tags).pluck(:name), label: false, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Indiquez une étiquette...' }, wrapper_html: { class: 'select2ed'}, include_blank: false, selected: params[:q] ? params[:q]['tag_search'] : nil .form-group.togglable = f.label Chouette::TimeTable.human_attribute_name(:bounding_dates), required: false, class: 'control-label' |
