diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 6504c3f27..7bb5b126a 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,6 +1,4 @@ class CommentsController < ApplicationController - include CustomUrlsHelper - before_action :authenticate_user!, only: :create before_action :load_commentable, only: :create before_action :verify_resident_for_commentable!, only: :create @@ -104,7 +102,7 @@ class CommentsController < ApplicationController return if current_user.administrator? || current_user.moderator? if @commentable.respond_to?(:comments_closed?) && @commentable.comments_closed? - redirect_to @commentable, alert: t("comments.comments_closed") + redirect_to polymorphic_hierarchy_path(@commentable), alert: t("comments.comments_closed") end end diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index e2293f2c3..ce257ae7d 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,6 +1,4 @@ class NotificationsController < ApplicationController - include CustomUrlsHelper - before_action :authenticate_user! skip_authorization_check diff --git a/app/helpers/custom_urls_helper.rb b/app/helpers/custom_urls_helper.rb deleted file mode 100644 index 1519e771e..000000000 --- a/app/helpers/custom_urls_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -module CustomUrlsHelper - def legislation_question_url(question) - legislation_process_question_url(question.process, question) - end - - def legislation_annotation_url(annotation) - legislation_process_question_url(annotation.draft_version.process, annotation.draft_version, annotation) - end -end