Class: Furatto::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/furatto_rails_helpers/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#label(attribute, text = nil, options = {}) ⇒ Object



19
20
21
22
23
# File 'lib/furatto_rails_helpers/form_builder.rb', line 19

def label(attribute, text = nil, options = {})
  options[:class] ||= ""
  options[:class] += " error" if has_error?(attribute)
  super(attribute, (text || "").html_safe, options)
end

#password_field(attribute, options = {}) ⇒ Object



25
26
27
28
29
# File 'lib/furatto_rails_helpers/form_builder.rb', line 25

def password_field(attribute, options = {})
  field attribute, options do |options|
    super(attribute, options.merge(:autocomplete => :off))
  end
end