Simple, nicer Rails notifications
Showandtell provides an incredibly easy way to integrate Twitter bootstrap notifications into your Rails 3.1+ app.
gem 'showandtell'to your Gemfile
*= require showandtellto your app/assets/stylesheets/application.css
Note that your notifications must have a class of
flash and an id of
flash_severity where severity is the type of notification - notice, alert, etc. The appropriate code for this is:
<% if flash %> <div id="flash_messages"> <% flash.each do |name, msg| %> <% if name == :notice %> <div class="alert alert-success"> <% elsif name == :alert %> <div class="alert alert-error"> <% else %> <div class="alert alert-info"> <% end %> <a class="close" data-dismiss="alert">×</a> <%= msg %> </div> <% end %> </div> <% end %>
If you run into a bug, please start by searching the GitHub issue tracker page. If you find one matching your problem, please feel free to add to the discussion. If you can't find one, please create a new issue.
- Fork the project on GitHub.
- Make your changes.
- Open a pull request. Let me know what you did and why you did it. Unless there is a really good reason for it, please don't tell me how you did it. That should be fairly evident from the new code. Assuming the request makes sense, I'll pull your changes.
- Gem created by J-P Teti
Licensed under the MIT license.