Module: Bureaucrat::Quickfields
- Includes:
- Fields
- Defined in:
- lib/bureaucrat/quickfields.rb
Instance Method Summary collapse
- #boolean(name, options = {}) ⇒ Object
- #choice(name, choices = [], options = {}) ⇒ Object
- #decimal(name, options = {}) ⇒ Object
- #email(name, options = {}) ⇒ Object
- #file(name, options = {}) ⇒ Object
- #hide(name) ⇒ Object
- #integer(name, options = {}) ⇒ Object
- #multiple_choice(name, choices = [], options = {}) ⇒ Object
- #null_boolean(name, options = {}) ⇒ Object
- #password(name, options = {}) ⇒ Object
- #regex(name, regexp, options = {}) ⇒ Object
- #string(name, options = {}) ⇒ Object
- #text(name, options = {}) ⇒ Object
- #typed_choice(name, choices = [], options = {}) ⇒ Object
Instance Method Details
#boolean(name, options = {}) ⇒ Object
44 45 46 |
# File 'lib/bureaucrat/quickfields.rb', line 44 def boolean(name, ={}) field name, BooleanField.new() end |
#choice(name, choices = [], options = {}) ⇒ Object
52 53 54 |
# File 'lib/bureaucrat/quickfields.rb', line 52 def choice(name, choices=[], ={}) field name, ChoiceField.new(choices, ) end |
#decimal(name, options = {}) ⇒ Object
28 29 30 |
# File 'lib/bureaucrat/quickfields.rb', line 28 def decimal(name, ={}) field name, BigDecimalField.new() end |
#email(name, options = {}) ⇒ Object
36 37 38 |
# File 'lib/bureaucrat/quickfields.rb', line 36 def email(name, ={}) field name, EmailField.new() end |
#file(name, options = {}) ⇒ Object
40 41 42 |
# File 'lib/bureaucrat/quickfields.rb', line 40 def file(name, ={}) field name, FileField.new() end |
#hide(name) ⇒ Object
7 8 9 10 |
# File 'lib/bureaucrat/quickfields.rb', line 7 def hide(name) base_fields[name] = base_fields[name].dup base_fields[name]. = Widgets::HiddenInput.new end |
#integer(name, options = {}) ⇒ Object
24 25 26 |
# File 'lib/bureaucrat/quickfields.rb', line 24 def integer(name, ={}) field name, IntegerField.new() end |
#multiple_choice(name, choices = [], options = {}) ⇒ Object
60 61 62 |
# File 'lib/bureaucrat/quickfields.rb', line 60 def multiple_choice(name, choices=[], ={}) field name, MultipleChoiceField.new(choices, ) end |
#null_boolean(name, options = {}) ⇒ Object
48 49 50 |
# File 'lib/bureaucrat/quickfields.rb', line 48 def null_boolean(name, ={}) field name, NullBooleanField.new() end |
#password(name, options = {}) ⇒ Object
20 21 22 |
# File 'lib/bureaucrat/quickfields.rb', line 20 def password(name, ={}) field name, CharField.new(.merge(:widget => Widgets::PasswordInput.new)) end |
#regex(name, regexp, options = {}) ⇒ Object
32 33 34 |
# File 'lib/bureaucrat/quickfields.rb', line 32 def regex(name, regexp, ={}) field name, RegexField.new(regexp, ) end |
#string(name, options = {}) ⇒ Object
12 13 14 |
# File 'lib/bureaucrat/quickfields.rb', line 12 def string(name, ={}) field name, CharField.new() end |
#text(name, options = {}) ⇒ Object
16 17 18 |
# File 'lib/bureaucrat/quickfields.rb', line 16 def text(name, ={}) field name, CharField.new(.merge(:widget => Widgets::Textarea.new)) end |
#typed_choice(name, choices = [], options = {}) ⇒ Object
56 57 58 |
# File 'lib/bureaucrat/quickfields.rb', line 56 def typed_choice(name, choices=[], ={}) field name, TypedChoiceField.new(choices, ) end |