awesome_flags 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +27 -11
  2. data/VERSION +1 -1
  3. data/awesome_flags.gemspec +1 -1
  4. metadata +3 -3
data/README.markdown CHANGED
@@ -1,23 +1,39 @@
1
- = awesome_flags
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
- $gem 'awesome_flags'
11
+ gem 'awesome_flags'
4
12
 
5
- AwesomeFlags returns the keys used in a FlagShihTzu column as symbols.
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
- To call all flags for a model use the method
10
- $my_flags
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
- To call just the flags from a specific column use:
13
- $my_flags("column_name")
27
+ all_flags
28
+ all_flags("column_name")
14
29
 
15
- Using the all_flags method will return all flags (filtered by column or not as above).
16
- These will test true/false for that object so can be used to generate checkboxes in a form.
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
- You can also send either method to a block to output formatted flags.
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.2.0
1
+ 1.3.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "awesome_flags"
8
- s.version = "1.2.0"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gabe Kessler"]
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: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabe Kessler