Class: Irelia::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Irelia::FormBuilder
- Defined in:
- lib/irelia/form_builder.rb
Instance Method Summary collapse
- #email_field(method, html_options = {}, &block) ⇒ Object
- #password_field(method, html_options = {}, &block) ⇒ Object
- #select(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
- #submit(value = nil, options = {}) ⇒ Object
-
#text_field(method, html_options = {}, &block) ⇒ Object
[:text_field, :text_area].each do |method_name| define_method(method_name) do |method, options = {}| render_component(method_name, method, options) end end.
Instance Method Details
#email_field(method, html_options = {}, &block) ⇒ Object
17 18 19 |
# File 'lib/irelia/form_builder.rb', line 17 def email_field(method, = {}, &block) render_component(:email_field, method, options: , html_options: , &block) end |
#password_field(method, html_options = {}, &block) ⇒ Object
13 14 15 |
# File 'lib/irelia/form_builder.rb', line 13 def password_field(method, = {}, &block) render_component(:password_field, method, options: , html_options: , &block) end |
#select(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
21 22 23 |
# File 'lib/irelia/form_builder.rb', line 21 def select(method, choices = nil, = {}, = {}, &block) render_component(:select, method, choices: choices, options: , html_options: , &block) end |
#submit(value = nil, options = {}) ⇒ Object
25 26 27 28 29 |
# File 'lib/irelia/form_builder.rb', line 25 def submit(value = nil, = {}) component = Irelia::Button::Component.new(type: :submit, html_options: ) component.with_content(value) if value component.render_in(@template) end |
#text_field(method, html_options = {}, &block) ⇒ Object
[:text_field, :text_area].each do |method_name|
define_method(method_name) do |method, = {}|
render_component(method_name, method, )
end
end
9 10 11 |
# File 'lib/irelia/form_builder.rb', line 9 def text_field(method, = {}, &block) render_component(:text_field, method, options: , html_options: , &block) end |