Skip to content

Commit b3cdae5

Browse files
committed
Unify redirect_to targets
1 parent 8c5730c commit b3cdae5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/controllers/error_template_attributes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def destroy
7676
@error_template_attribute.destroy
7777
respond_to do |format|
7878
format.html do
79-
redirect_to error_template_attributes_url, notice: t('shared.object_destroyed', model: @error_template_attribute.class.model_name.human)
79+
redirect_to ErrorTemplateAttribute, notice: t('shared.object_destroyed', model: @error_template_attribute.class.model_name.human)
8080
end
8181
format.json { head :no_content }
8282
end

app/controllers/error_templates_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def destroy
7070
authorize!
7171
@error_template.destroy
7272
respond_to do |format|
73-
format.html { redirect_to error_templates_url, notice: t('shared.object_destroyed', model: @error_template.class.model_name.human) }
73+
format.html { redirect_to ErrorTemplate, notice: t('shared.object_destroyed', model: @error_template.class.model_name.human) }
7474
format.json { head :no_content }
7575
end
7676
end

app/controllers/file_templates_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def destroy
7878
authorize!
7979
@file_template.destroy
8080
respond_to do |format|
81-
format.html { redirect_to file_templates_url, notice: t('shared.object_destroyed', model: @file_template.class.model_name.human) }
81+
format.html { redirect_to FileTemplate, notice: t('shared.object_destroyed', model: @file_template.class.model_name.human) }
8282
format.json { head :no_content }
8383
end
8484
end

app/controllers/subscriptions_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def destroy
2626
rescue StandardError
2727
skip_authorization
2828
respond_to do |format|
29-
format.html { redirect_to request_for_comments_url, alert: t('subscriptions.subscription_not_existent') }
29+
format.html { redirect_to RequestForComment, alert: t('subscriptions.subscription_not_existent') }
3030
format.json { render json: {message: t('subscriptions.subscription_not_existent')}, status: :not_found }
3131
end
3232
else
@@ -35,12 +35,12 @@ def destroy
3535
@subscription.deleted = true
3636
if @subscription.save
3737
respond_to do |format|
38-
format.html { redirect_to request_for_comment_url(rfc), notice: t('subscriptions.successfully_unsubscribed') }
38+
format.html { redirect_to rfc, notice: t('subscriptions.successfully_unsubscribed') }
3939
format.json { render json: {message: t('subscriptions.successfully_unsubscribed')}, status: :ok }
4040
end
4141
else
4242
respond_to do |format|
43-
format.html { redirect_to request_for_comment_url(rfc), flash: {danger: t('shared.message_failure')} }
43+
format.html { redirect_to rfc, flash: {danger: t('shared.message_failure')} }
4444
format.json { render json: {message: t('shared.message_failure')}, status: :internal_server_error }
4545
end
4646
end

0 commit comments

Comments
 (0)