aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert2017-10-16 12:34:58 +0200
committerRobert2017-10-16 15:15:26 +0200
commit47adef1ecb8867a6bba74dd3e892130ad70c7b32 (patch)
tree071ff54c4e026d8c6d89e1cf0e36491e2cdff852
parent87e4f61382968c7029192edaa52e74a961b490d6 (diff)
downloadchouette-core-4728-hstore-presence-validation.tar.bz2
Refs: #4728@2h; hstore not created from params in Controller#build_resource because it needs symbol keys [Theory to be proven]4728-hstore-presence-validation
-rw-r--r--app/controllers/compliance_controls_controller.rb2
-rw-r--r--app/views/layouts/navigation/_main_nav_left.html.slim21
2 files changed, 12 insertions, 11 deletions
diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb
index 6fe799267..3b5bddbe7 100644
--- a/app/controllers/compliance_controls_controller.rb
+++ b/app/controllers/compliance_controls_controller.rb
@@ -27,7 +27,7 @@ class ComplianceControlsController < BreadcrumbController
alias_method :compliance_control, :resource
def build_resource
- @compliance_control ||= compliance_control_class.new compliance_control_set: parent
+ @compliance_control = compliance_control_class.new compliance_control_set: parent, **(params.fetch('compliance_control', {}))
end
private
diff --git a/app/views/layouts/navigation/_main_nav_left.html.slim b/app/views/layouts/navigation/_main_nav_left.html.slim
index 062c9383c..837b9cb73 100644
--- a/app/views/layouts/navigation/_main_nav_left.html.slim
+++ b/app/views/layouts/navigation/_main_nav_left.html.slim
@@ -31,16 +31,17 @@
#miTwo.panel-collapse.collapse
.list-group
- = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do
- span Jeux de données
- = link_to workbench_imports_path(current_offer_workbench), class: "list-group-item #{(params[:controller] == 'imports') ? 'active' : ''}" do
- span Import
- = link_to calendars_path, class: 'list-group-item' do
- span Modèles de calendrier
- = link_to workbench_compliance_check_sets_path(current_offer_workbench), class: 'list-group-item' do
- span Rapport de contrôle
- = link_to compliance_control_sets_path, class: 'list-group-item' do
- span Jeux de contrôle
+ - if current_user
+ = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do
+ span Jeux de données
+ = link_to workbench_imports_path(current_offer_workbench), class: "list-group-item #{(params[:controller] == 'imports') ? 'active' : ''}" do
+ span Import
+ = link_to calendars_path, class: 'list-group-item' do
+ span Modèles de calendrier
+ = link_to workbench_compliance_check_sets_path(current_offer_workbench), class: 'list-group-item' do
+ span Rapport de contrôle
+ = link_to compliance_control_sets_path, class: 'list-group-item' do
+ span Jeux de contrôle
.menu-item.panel
.panel-heading