awesome_flags 1.2.0 → 1.3.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.markdown +27 -11
- data/VERSION +1 -1
- data/awesome_flags.gemspec +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -1,23 +1,39 @@
|
|
1
|
-
|
1
|
+
# awesome_flags
|
2
|
+
|
3
|
+
You'll need the FlagShihTzu plugin installed.
|
4
|
+
|
5
|
+
plugin install git://github.com/xing/flag_shih_tzu.git
|
6
|
+
|
7
|
+
Then set that up how you like. [FlagShihTzu](http://github.com/xing/flag_shih_tzu.git "FlagShihTzu repo")
|
8
|
+
|
9
|
+
Then get the awesome_flags gem.
|
2
10
|
|
3
|
-
|
11
|
+
gem 'awesome_flags'
|
4
12
|
|
5
|
-
AwesomeFlags
|
13
|
+
## AwesomeFlags outputs the keys used in FlagShihTzu columns as an Array of :symbols.
|
6
14
|
|
7
15
|
Just require AwesomeFlags in your model. Don't forget to install the FlagShihTzu plugin and add that as well.
|
8
16
|
|
9
|
-
|
10
|
-
|
17
|
+
include FlagShihTzu
|
18
|
+
include AwesomeFlags
|
19
|
+
|
20
|
+
Call all active flags for a variable, or add a column name to filter.
|
21
|
+
|
22
|
+
my_flags
|
23
|
+
my_flags("column_name")
|
24
|
+
|
25
|
+
Using the all_flags method will return all flags (filtered by column or not).
|
11
26
|
|
12
|
-
|
13
|
-
|
27
|
+
all_flags
|
28
|
+
all_flags("column_name")
|
14
29
|
|
15
|
-
|
16
|
-
|
30
|
+
You can also send either method to a block to output formatted flags.
|
31
|
+
This can be handy to do things like generate check boxes dynamically. For example
|
17
32
|
|
18
|
-
|
33
|
+
- @form.all_flags.each do |flag|
|
34
|
+
= check_box flag, :class => 'check_box'
|
35
|
+
= label :flags, "#{flag.to_s.titleize}"
|
19
36
|
|
20
|
-
== Copyright
|
21
37
|
|
22
38
|
Copyright (c) 2011 Gabe Kessler. See LICENSE.txt for
|
23
39
|
further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/awesome_flags.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_flags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabe Kessler
|