Class: WorthSaving::FormBuilder
- Inherits:
-
Object
- Object
- WorthSaving::FormBuilder
- Defined in:
- lib/worth_saving/form_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #check_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
- #fields_for(record_name, options = {}, &bloc) ⇒ Object
- #hidden_field(method, options = {}) ⇒ Object
- #radio_button(method, tag_value, options = {}) ⇒ Object
- #select(method, choices, options = {}, html_options = {}) ⇒ Object
- #submit(value = nil, options = {}) ⇒ Object
- #text_area(method, options = {}) ⇒ Object
- #text_field(method, options = {}) ⇒ Object
Class Method Details
.next_form_id ⇒ Object
43 44 45 46 |
# File 'lib/worth_saving/form_builder.rb', line 43 def self.next_form_id @@worth_saving_form_id ||= 0 @@worth_saving_form_id += 1 end |
Instance Method Details
#check_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
13 14 15 16 |
# File 'lib/worth_saving/form_builder.rb', line 13 def check_box(method, = {}, checked_value = "1", unchecked_value = "0") method, super end |
#fields_for(record_name, options = {}, &bloc) ⇒ Object
33 34 35 36 |
# File 'lib/worth_saving/form_builder.rb', line 33 def fields_for(record_name, = {}, &bloc) [:builder] = [:builder].superclass unless object.worth_saving? record_name super end |
#hidden_field(method, options = {}) ⇒ Object
28 29 30 31 |
# File 'lib/worth_saving/form_builder.rb', line 28 def hidden_field(method, = {}) method, super end |
#radio_button(method, tag_value, options = {}) ⇒ Object
8 9 10 11 |
# File 'lib/worth_saving/form_builder.rb', line 8 def (method, tag_value, = {}) method, super end |
#select(method, choices, options = {}, html_options = {}) ⇒ Object
23 24 25 26 |
# File 'lib/worth_saving/form_builder.rb', line 23 def select(method, choices, = {}, = {}) method, super end |
#submit(value = nil, options = {}) ⇒ Object
38 39 40 41 |
# File 'lib/worth_saving/form_builder.rb', line 38 def submit(value = nil, = {}) value = 'Choose this copy' if self.[:worth_saving_recovery] super end |
#text_area(method, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/worth_saving/form_builder.rb', line 18 def text_area(method, = {}) method, super end |
#text_field(method, options = {}) ⇒ Object
3 4 5 6 |
# File 'lib/worth_saving/form_builder.rb', line 3 def text_field(method, = {}) method, super end |