I am using Rails 4 with Bootstrap 3.0.
When I save a record in respond_to do |format| block, I redirect_to the next screen with a :notice set to some value, say "Record created". This displays in the text in green. When I have some error situation, I do a flash.now[:danger] = "error occurred". This displays the message in red inside a box.
The requirement is: whether it is an error message or a regular notice, it should be displayed in a uniform fashion, except for the color change, though. In other words, I want the flash[:danger] to display text inside a box and the :notice to display in green with a box too.
I have searched a lot on google and stackoverflow but can't find any way out.
Please help!
Code:
1: format.html {redirect_to '/new', notice: 'This notice displays in green, and I want it to display green inside a box'}
- flash.now[:danger] = "This displays red inside a box"
Thanks a million!