Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/hubs/N/tags/nonexistent shouldn't redirect to /hubs/N/items #50

Open
zackw opened this issue Mar 8, 2018 · 1 comment
Open

/hubs/N/tags/nonexistent shouldn't redirect to /hubs/N/items #50

zackw opened this issue Mar 8, 2018 · 1 comment

Comments

@zackw
Copy link

zackw commented Mar 8, 2018

If you try to load the tags page for a nonexistent tag, it silently redirects you to the "all items" screen for the hub, instead of telling you that there are no items with that tag. This made me think #49 was some sort of catastrophic database bug instead of a mere rendering problem.

@zackw
Copy link
Author

zackw commented Mar 8, 2018

The tags controller tries to show an error message ...

    unless @tag
      flash.now[:error] = "We're sorry, but '#{params[:name]}' is not a tag for '#{@hub.title}'"

      redirect_to hub_path(@hub)
    end

... but the redirection drops the flash on the floor. It should be flash[:error] = ....

adl1995 added a commit to adl1995/tagteam that referenced this issue Mar 26, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant