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:
= Copy to clipboard Copied!

install:
=

Versions:

  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)
Show all versions (9 total)

Owners:

Authors:

  • Leonid Shevtsov

SHA 256 checksum:

f017a19e2ff2000f68882a74d80ed13eb61785bdf8439e76d269c3f7e8eb82e5

Total downloads 348,495

For this version 3,225

Licenses:

N/A

Required Ruby Version: None

Links: