Class: Para::Inputs::I18nInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
lib/para/i18n/i18n_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



6
7
8
9
# File 'lib/para/i18n/i18n_input.rb', line 6

def input(wrapper_options = nil)
  model = object.class
  render
end

#renderObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/para/i18n/i18n_input.rb', line 11

def render
  (:div, class: 'row') do
    (:div, class: 'col-md-6') do
      ::I18n.with_locale(::I18n.default_locale) do
        original_content
      end
    end +
    (:div, class: 'col-md-6') do
      ::I18n.with_locale(locale) do
        @builder.input_field(attribute_name, input_options)
      end
    end
  end
end