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 = {}, &block) ⇒ Object



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

def globalize(options={}, &block)
  locales = options[:locales] || Sunrise.available_locales
  html = []
  
  html.join.html_safe
end

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



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

def input(attribute_name, options = {}, &block)
  options[:input_html] ||= {}
  options[:input_html] = {:class => 'text'}.merge(options[:input_html])
  
  attribute_name = "#{attribute_name}_#{options[:locale]}" unless options[:locale].blank?
  
  super(attribute_name, options, &block)
end