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

Turbolinks? #37

Open
chevinbrown opened this issue May 24, 2016 · 6 comments
Open

Turbolinks? #37

chevinbrown opened this issue May 24, 2016 · 6 comments

Comments

@chevinbrown
Copy link

It looks like turbolinks interferes with the operation of this gem. I haven't dug in yet. Is there a fix for Rails5/Turbolinks3?

@yurijmi
Copy link

yurijmi commented Jul 19, 2016

Yeah, I can confirm that. There is definitely some interference with Turbolinks 5.0.0

estum added a commit that referenced this issue Jul 19, 2016
@kikikiblue
Copy link

It still doesn't show flash message with turbolinks 5.0.1 (rails 5.1.4) when I use 'redirect_to'
but it shows flash message if I use 'data: {turbolinks: false}' to link_to method.
Anybody have some hint?

@chevinbrown
Copy link
Author

Seems like this gem isn't actively maintained. I recommend you take a look at the unobtrusive flash gem

@estum
Copy link
Owner

estum commented Nov 30, 2017

@kikikiblue try to use ActionDispatch::Flash::FlashHash#keep method.

@kikikiblue
Copy link

@estum I tried this code. but it does not show the notice flash message either.

flash.keep
return redirect_back(fallback_location: root_path), flash: {notice: 'Email sent'}

what is the right usage?

@kikikiblue
Copy link

I was stupid. :-p

flash[:notice] = 'Email sent'
flash.keep
return redirect_back(fallback_location: root_path)

It works with this code. Thanks @estum

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

4 participants