README.md in gritter-1.0.1 vs README.md in gritter-1.0.2

- old
+ new

@@ -1,8 +1,8 @@ # gritter - version 1.0.1 + version 1.0.2 Robin Brouwer Daniƫl Zwijnenburg 45north This Ruby on Rails gem allows you to easily add Growl-like notifications to your application using a jQuery plugin called 'gritter'. [Check out the demo for this plugin](http://boedesign.com/demos/gritter/). @@ -15,11 +15,11 @@ ## Installation You can use this gem by putting the following inside your Gemfile: - gem "gritter", "1.0.1" + gem "gritter", "1.0.2" Now generate the locale for gritter: rails g gritter:locale @@ -33,10 +33,14 @@ And that's it! ## Changes +Version 1.0.2 changes (03/09/2012): + + - Merged pull request #22 (namespaced controllers gflash fix). + Version 1.0.1 changes (23/01/2012): - Fixed gflash(:js => true) in Ruby 1.9.2 and 1.9.3. Version 1.0.0 changes (17/11/2011): @@ -231,12 +235,25 @@ gflash :success => { :time => 2000, :class_name => "my_class", :sticky => true } gflash :success => { :value => true, :time => 2000, :class_name => "my_class", :sticky => true } gflash :error => { :value => "Custom error", :time => 3000, :class_name => "my_error_class", :sticky => false } -When you don't pass a `:value` it uses the locale. Same goes for when you pass `true` to `:value`. +When you don't pass a `:value` it uses the locale. Same goes for when you pass `true` to `:value`. When you give `:value` a String, that String will be used to display the message. Here's another example: + def create + @user = User.new(params[:user]) + if @user.save + gflash :success => { :value => "Account has been created!", :time => 5000 }, + :notice => { :value => "You have received an e-mail notification.", :sticky => true } + redirect_to :root + else + gflash :error => { :value => "Something went wrong.", :time => 4000 }, + :warning => { :value => "Some fields weren't filled in correctly.", :time => 7000 } + render :new + end + end + You can also use gflash directly inside the `redirect_to` method. def create redirect_to @post, :gflash => [:notice, :success] end @@ -249,9 +266,30 @@ redirect_to :login, :gflash => { :error => { :value => "You are not logged in!", :sticky => true } } end And that's how you add gflash to your Rails application! +## Copyright + +Copyright (C) 2010 Robin Brouwer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. ## Special Thanks We'd like to express our gratitude to the following people: \ No newline at end of file