flash_helper 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +62 -0
- data/test/flash_helper_test.rb +8 -0
- metadata +53 -0
data/README
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
-*-markdown-*-
|
|
2
|
+
|
|
3
|
+
FlashHelper
|
|
4
|
+
===========
|
|
5
|
+
|
|
6
|
+
This extension provides a simple way to handle flash messages.
|
|
7
|
+
You can easily display notices, errors and warnings using the convinience method.
|
|
8
|
+
|
|
9
|
+
Installation
|
|
10
|
+
------------
|
|
11
|
+
|
|
12
|
+
In your Rails app root, use the following command-line :
|
|
13
|
+
|
|
14
|
+
cd vendor/plugins
|
|
15
|
+
hg clone http://bitbucket.org/Bounga/flash-helper
|
|
16
|
+
|
|
17
|
+
If you want to install the flash_helper CSS file in your stylesheets directory, use :
|
|
18
|
+
|
|
19
|
+
rake flash_helper:install
|
|
20
|
+
|
|
21
|
+
Example
|
|
22
|
+
-------
|
|
23
|
+
|
|
24
|
+
For example, in your layout use :
|
|
25
|
+
|
|
26
|
+
display_flashes
|
|
27
|
+
|
|
28
|
+
Then in your controllers you can use :
|
|
29
|
+
|
|
30
|
+
flash[:notice] = "Successfully created..."
|
|
31
|
+
flash[:errors] = "Creation failed!"
|
|
32
|
+
flash[:errors] = @news.errors
|
|
33
|
+
flash[:warning] = "The new user has no blog associated..."
|
|
34
|
+
|
|
35
|
+
Tune display_flashes :
|
|
36
|
+
|
|
37
|
+
Options for flash helpers are optional and get their default values from the
|
|
38
|
+
Bounga::FlashHelper::ViewHelpers.flash_options hash. You can write to this hash to
|
|
39
|
+
override default options on the global level:
|
|
40
|
+
|
|
41
|
+
Bounga::FlashHelper::ViewHelpers.flash_options[:notice_class] = 'my_notice'
|
|
42
|
+
|
|
43
|
+
Available options (and their defaults) are :
|
|
44
|
+
|
|
45
|
+
:list_class => 'errors_list'
|
|
46
|
+
:notice_class => 'notice'
|
|
47
|
+
:errors_class => 'errors'
|
|
48
|
+
:warning_class => 'warning'
|
|
49
|
+
:default_message => 'There are problems in your submission:'
|
|
50
|
+
|
|
51
|
+
By putting this into "config/initializers/flash_helper.rb" (or simply environment.rb in
|
|
52
|
+
older versions of Rails) you can easily override any default option.
|
|
53
|
+
|
|
54
|
+
Other
|
|
55
|
+
-----
|
|
56
|
+
|
|
57
|
+
More information on [Project homepage](http://www.bitbucket.org/Bounga/flash-helper)
|
|
58
|
+
|
|
59
|
+
Problems, comments, and suggestions are welcome on the [ticket system](http://www.bitbucket.org/Bounga/flash-helper/tickets/new)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Copyright (c) 2008 Nicolas Cavigneaux, released under the MIT license
|
metadata
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: flash_helper
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Nicolas Cavigneaux
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2008-12-05 00:00:00 +01:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies: []
|
|
15
|
+
|
|
16
|
+
description: This Rails extension provides a simple way to handle flash messages. You can easily display notices, errors and warnings using the convinience method.
|
|
17
|
+
email: nico@bounga.org
|
|
18
|
+
executables: []
|
|
19
|
+
|
|
20
|
+
extensions: []
|
|
21
|
+
|
|
22
|
+
extra_rdoc_files:
|
|
23
|
+
- README
|
|
24
|
+
files:
|
|
25
|
+
- README
|
|
26
|
+
has_rdoc: true
|
|
27
|
+
homepage: http://www.bitbucket.org/Bounga/flash-helper
|
|
28
|
+
post_install_message:
|
|
29
|
+
rdoc_options: []
|
|
30
|
+
|
|
31
|
+
require_paths:
|
|
32
|
+
- lib
|
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: "0"
|
|
38
|
+
version:
|
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: "0"
|
|
44
|
+
version:
|
|
45
|
+
requirements: []
|
|
46
|
+
|
|
47
|
+
rubyforge_project: flash-helper
|
|
48
|
+
rubygems_version: 1.3.1
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 2
|
|
51
|
+
summary: Rails extension to handle flash messages
|
|
52
|
+
test_files:
|
|
53
|
+
- test/flash_helper_test.rb
|