Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (66 sloc) 1.738 kb
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
1 # Flash Message Conductor
2
3 A simple pattern for managing flash messages in your Ruby on Rails application.
4
5 ## Installation
6
9c1f51e4 » eddorre
2012-12-10 Fixed formatting error in README
7 ***This branch is only used for Rails 3. Still using Rails 2? Use [https://github.com/planetargon/flash-message-conductor/tree/rails2](https://github.com/planetargon/flash-message-conductor/tree/rails2) instead.***
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
8
9 Add this line to your application's Gemfile:
10
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
11 ```ruby
12 gem "flash-message-conductor", "~> 2.0.1"
13 ```
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
14
15 And then execute:
16
17 $ bundle
18
b0fb37e0 » eddorre
2012-12-11 Updating README for new Gem instructions
19 Or install it yourself as:
20
21 gem install flash-message-conductor
22
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
23 ## Usage
24
25 ### Controller helpers
26
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
27 ```ruby
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
28 add_message('foo')
29 ```
30
31 **Is the equivalent of:**
32
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
33 ```ruby
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
34 flash[:message] = 'foo'
35 ```
8e8ffdc3 » eddorre
2013-05-30 Added support for flash methods, keep, now, and discard. Updated READ…
36 **Flash methods Keep, discard, and now are also supported**
37
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
38 ```ruby
8e8ffdc3 » eddorre
2013-05-30 Added support for flash methods, keep, now, and discard. Updated READ…
39 add_message('foo', :state => :keep)
40 ```
41
42 **Is the equivalent of:**
43
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
44 ```ruby
8e8ffdc3 » eddorre
2013-05-30 Added support for flash methods, keep, now, and discard. Updated READ…
45 flash[:message] = 'foo'
46 flash.keep(:message)
47 ```
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
48
49 **Rails Controller helpers included:**
50
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
51 ```ruby
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
52 add_message(message)
53 add_notice(message)
54 add_error(message)
51c22a9f » eddorre
2013-04-05 Updated README for 2.0.1 release.
55 add_alert(message)
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
56 ```
57
58 ### View helpers
59
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
60 ```erb
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
61 <%= render_flash_messages %>
62 ```
63
64 **Produces:**
65
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
66 ```html
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
67 <div id="flash_messages">
68 <p class="message">You have successfully done XYZ...</p>
69 </div>
70 ```
71
72 **Or... if you set an error:**
73
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
74 ```html
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
75 <div id="flash_messages">
76 <p class="error">Oops! Something went bonkers!<p>
77 </div>
78 ```
79
80 **Or:**
81
c6368d59 » markijbema
2013-12-06 Added syntax highlighting to readme
82 ```erb
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
83 <% if flash_message_set? -%>
84 # do something
85 <% end -%>
86 ```
87
51c22a9f » eddorre
2013-04-05 Updated README for 2.0.1 release.
88 Copyright (c) 2008-2013 Planet Argon, released under the MIT license
19845a23 » eddorre
2012-12-10 Updated README and renamed it to README.md
89
90 ### Contributing
91
92 1. Fork it
93 2. Create your feature branch (`git checkout -b my-new-feature`)
94 3. Commit your changes (`git commit -am 'Add some feature'`)
95 4. Push to the branch (`git push origin my-new-feature`)
96 5. Create new Pull Request
Something went wrong with that request. Please try again.