From d504af321657c27c2e7fc940a02393afd89a1c1d Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 10 Sep 2018 20:19:03 +0200 Subject: [PATCH 1/2] FeedbacksController should inherit from UserController --- app/controllers/new_user/feedbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/new_user/feedbacks_controller.rb b/app/controllers/new_user/feedbacks_controller.rb index 3c7b391da..9ec9b97bc 100644 --- a/app/controllers/new_user/feedbacks_controller.rb +++ b/app/controllers/new_user/feedbacks_controller.rb @@ -1,4 +1,4 @@ -class NewUser::FeedbacksController < ApplicationController +class NewUser::FeedbacksController < UserController def create current_user.feedbacks.create!(rating: params[:rating]) flash.notice = "Merci de votre retour, si vous souhaitez nous en dire plus, n'hésitez pas à #{view_context.contact_link('nous contacter', type: Helpscout::FormAdapter::TYPE_AMELIORATION)}." From 05d2988f610b55cdf90e1e3c2c9c8f5182c26893 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 10 Sep 2018 20:20:58 +0200 Subject: [PATCH 2/2] Format FeedbackController like the other controllers --- app/controllers/new_user/feedbacks_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/new_user/feedbacks_controller.rb b/app/controllers/new_user/feedbacks_controller.rb index 9ec9b97bc..40ec33f80 100644 --- a/app/controllers/new_user/feedbacks_controller.rb +++ b/app/controllers/new_user/feedbacks_controller.rb @@ -1,6 +1,8 @@ -class NewUser::FeedbacksController < UserController - def create - current_user.feedbacks.create!(rating: params[:rating]) - flash.notice = "Merci de votre retour, si vous souhaitez nous en dire plus, n'hésitez pas à #{view_context.contact_link('nous contacter', type: Helpscout::FormAdapter::TYPE_AMELIORATION)}." +module NewUser + class FeedbacksController < UserController + def create + current_user.feedbacks.create!(rating: params[:rating]) + flash.notice = "Merci de votre retour, si vous souhaitez nous en dire plus, n'hésitez pas à #{view_context.contact_link('nous contacter', type: Helpscout::FormAdapter::TYPE_AMELIORATION)}." + end end end