The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called ‘Layouts and Rendering in Rails’, does not work for me:

I’m confused as to why that Rails Guide mentions using flash values in render, since they only appear to work in redirect_to at the moment. I think you’ll find your approach works if you put a flash.now[:alert] = 'Alert message!' before your render method call.

Edit: this is a flaw in the guides that will be fixed, you should use the separate method call to set the flash prior to calling render.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)