Skip to content

Commit

Permalink
Fix flash message for a non-existent tags page
Browse files Browse the repository at this point in the history
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 berkmancenter#50
  • Loading branch information
adl1995 committed Mar 26, 2018
1 parent da8a744 commit 8e6bc5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e6bc5a

Please sign in to comment.