Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Rails flash notice won't go away in Safari?

flash sessions safari

  • Please log in to reply
42 replies to this topic

#41 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 16 December 2013 - 10:17 AM

So what remains is the "How to get the url to return to?" question

In the

def set_redirect_to

method, grab the url from the current controller/action if it is too late in the process and the current action gives you the action that has already been moved on to in the after filter then use a before_filter to stuff it into another session variable the you can then use in the after filter to set the value for the return_to key.

 

Possibly worth trying 

request.original_url

but as there seems to be an issue with the request object in Safari 7, I am not comfortable with suggesting this as a solution for this particular case.

 

So you might want to try

controller_path

instead. I'm not sure if controller_path will provide any params that are needed though.

 

Hope that makes sense. If you need further help just shout


Programming is just about problem solving!


#42 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 16 December 2013 - 10:41 AM

There is no guarantee of course, that the above will solve the flash message issue, I can only think that it will as it addresses the difference between when it works and when it doesn't work. I still think that it may be down to page caching somehow.

Anyway the above has to be worth a try. If it doesn't fix the issue then I'm sorry, but for once in my life I am totally out of ideas.


Programming is just about problem solving!


#43 joshukraine

joshukraine

    Signalman

  • Members
  • 20 posts

Posted 16 December 2013 - 10:43 AM

Hey James,

 

Thanks for the new input. I'll be sure to try in out and let you know. :)







Also tagged with one or more of these keywords: flash, sessions, safari

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users