estum / growlyflash

Growl-styled flash messages for Ruby on Rails and Bootstrap
MIT License
58 stars 34 forks source link

Turbolinks? #37

Open chevinbrown opened 8 years ago

chevinbrown commented 8 years ago

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 commented 8 years ago

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

kikikiblue commented 6 years ago

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 commented 6 years ago

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

estum commented 6 years ago

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

kikikiblue commented 6 years ago

@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 commented 6 years ago

I was stupid. :-p

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

It works with this code. Thanks @estum