From 8e6bc5a128c6b299878d41bf071fea53424f98a8 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Mon, 26 Mar 2018 10:58:39 +0500 Subject: [PATCH] Fix flash message for a non-existent tags page Currently, the application redirects the user to 'all items' screen for the hub, if a tags page does not exist. The solution is to use flash instead of flash.now, as the latter is only used for rendering. This issue was raised in #50 --- app/controllers/tags_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index c6f0ca70..8ce37b4c 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -127,7 +127,7 @@ def load_tag_from_name ActsAsTaggableOn::Tag.find_by(id: params[:id]) end unless @tag - flash.now[:error] = "We're sorry, but '#{params[:name]}' is not a tag for '#{@hub.title}'" + flash[:error] = "We're sorry, but '#{params[:id]}' is not a tag for '#{@hub.title}'" redirect_to hub_path(@hub) end