Class: Sunrise::Views::FormBuilder

Inherits:
SimpleForm::FormBuilder
  • Object
show all
Includes:
ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
Defined in:
lib/sunrise/views/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#globalize(options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/sunrise/views/form_builder.rb', line 21

def globalize(options = {})
  locales = options[:locales] || Sunrise.available_locales
  html = []

  html.join.html_safe
end

#input(attribute_name, options = {}, &block) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/sunrise/views/form_builder.rb', line 12

def input(attribute_name, options = {}, &block)
  options[:input_html] ||= {}
  options[:input_html] = { class: 'text' }.merge(options[:input_html])

  attribute_name = "#{attribute_name}_#{options[:locale]}" if options[:locale].present?

  super(attribute_name, options, &block)
end