Created: 2008-09-01 09:05
Updated: 2016-05-08 12:42
License: mit



A little plugin for Rails that gives you a handy way of creating a div to display a message to the user -- whether an informational message or a message indicating success or failure -- and doing so in a consistent way.


<%= message_div_for :notice, flash[:notice] %>

<%= message_div_for :success, @success, {}, :style => "border: 1px solid green" %>

<% message_div_for :error do %>
  Some content goes here
<% end %>


Nothing special here, just the ordinary:

script/plugin install git://

Be aware that when you install the plugin, three images will be installed to public/images/message_div_helpers. These are just icons for each of the message types, taken from the fabulous "silk" icon set at Also, a stylesheet is installed to public/stylesheet/message_div_helpers.css. These add styling to the error divs themselves.


If you find a bug or have a feature request, I want to know about it! Feel free to file a Github issue, or do one better and fork the project on Github and send me a pull request or patch. Be sure to add tests if you do so, though.

You can also email me, or find me on Twitter.


(c) 2009-2010 Elliot Winkler. See LICENSE for details.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more