RubyGems Navigation menu

unobtrusive_flash 0.0.1

# Unobtrusive flash messages for Rails Ever got tired of pages that can't be cached because they contain flash messages? Ever got tired of writing custom code to handle flash messages passed in AJAX responses? Here comes the solution. `unobtrusive_flash` takes your flash messages for the backend and automagically passes them to the frontend via HTTP cookies. This works with both regular page loads and AJAX requests, does not tamper with the page body and requires about 3 extra lines of code in your app - how's that for unobtrusive? You can pass up to 4K of text into flash this way, and you don't need to worry about cookie size since they are cleared immediately upon rendering. Tested and fully functional in: * Internet Explorer 8 * Firefox 4b7 * Chrome 7 * Safari 5 * Opera 10.6 * *please let me know if it works in firefox 3 and ie 6, 7* ## Requirements * Rails 2.3 or 3 * jQuery (maybe I'll make it agnostic in the future) ## Usage 1. Add the gem to your Rails app. 2. Run `script/generate unobtrusive_flash` or `rails g unobtrusive_flash:install` 3. Add the following to the controllers that generate flash messages (or better, to the `ApplicationController`): after_filter :prepare_unobtrusive_flash 4. Include `unobtrusive_flash.css` and `unobtrusive_flash.js` in your layouts. No custom markup is needed. 5. Remove existing flash rendering code from your layouts. 6. That's all! You can also edit the generated CSS/JS to your liking. * * * © 2010 Leonid Shevtsov, released under the MIT license

Gemfile:
=

installieren:
=

Versionen:

  1. 3.3.1 November 17, 2016 (17,5 KB)
  2. 3.3.0 November 08, 2016 (17,5 KB)
  3. 3.2.0 November 06, 2015 (16 KB)
  4. 3.1.0 June 23, 2014 (10 KB)
  5. 3.0.0 March 07, 2014 (9,5 KB)
  6. 0.0.1 November 17, 2010 (6,5 KB)
Zeige alle Versionen (9 total)

Besitzer:

Autoren:

  • Leonid Shevtsov

SHA 256-Prüfsumme:

=

Downloads insgesamt 369.812

Für diese Version 3.315

Version veröffentlicht:

Lizenzen:

k.A.

Erforderliche Ruby-Version: None

Links: