Module: Releaf::Builders::FormBuilder::TextFields
- Included in:
- Fields
- Defined in:
- app/builders/releaf/builders/form_builder/text_fields.rb
Instance Method Summary collapse
- #releaf_email_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
- #releaf_link_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
- #releaf_password_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
- #releaf_text_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
- #releaf_textarea_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
Instance Method Details
#releaf_email_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
17 18 19 20 21 |
# File 'app/builders/releaf/builders/form_builder/text_fields.rb', line 17 def releaf_email_field(name, input: {}, label: {}, field: {}, options: {}, &block) = {field: {type: "email"}}.deep_merge() input = {type: "email"}.deep_merge(input) releaf_text_field(name, input: input, label: label, field: field, options: , &block) end |
#releaf_link_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
23 24 25 26 |
# File 'app/builders/releaf/builders/form_builder/text_fields.rb', line 23 def releaf_link_field(name, input: {}, label: {}, field: {}, options: {}, &block) = {field: {type: "link"}}.deep_merge() releaf_text_field(name, input: input, label: label, field: field, options: , &block) end |
#releaf_password_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/builders/releaf/builders/form_builder/text_fields.rb', line 28 def releaf_password_field(name, input: {}, label: {}, field: {}, options: {}, &block) attributes = input_attributes(name, {autocomplete: "off", class: "text"}.merge(input), ) = {field: {type: "password"}}.deep_merge() content = password_field(name, attributes) input_wrapper_with_label(name, content, label: label, field: field, options: , &block) end |
#releaf_text_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/builders/releaf/builders/form_builder/text_fields.rb', line 36 def releaf_text_field(name, input: {}, label: {}, field: {}, options: {}, &block) attributes = input_attributes(name, {value: object.send(name), class: "text"}.merge(input), ) = {field: {type: "text"}}.deep_merge() content = text_field(name, attributes) input_wrapper_with_label(name, content, label: label, field: field, options: , &block) end |
#releaf_textarea_field(name, input: {}, label: {}, field: {}, options: {}, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/builders/releaf/builders/form_builder/text_fields.rb', line 2 def releaf_textarea_field(name, input: {}, label: {}, field: {}, options: {}, &block) attributes = { rows: 5, cols: 75, value: object.send(name) }.merge(input) attributes = input_attributes(name, attributes, ) = {field: {type: "textarea"}}.deep_merge() content = text_area(name, attributes) input_wrapper_with_label(name, content, label: label, field: field, options: , &block) end |