Module: SimpleFormFormBuilderExtensions

Defined in:
app/extensions/concerns/simple_form_form_builder_extensions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#editor(*args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/extensions/concerns/simple_form_form_builder_extensions.rb', line 3

def editor(*args)
  options = args.extract_options!
  syntax = options.delete(:syntax)

  input_html = options.key?(:input_html) ? options[:input_html] : {}

  input_html['data-add-editor'] = true

  input_html['data-editor-syntax'] = syntax if syntax.present?

  options[:input_html] = input_html

  input(*args, options)
end

#locale_input(attribute_name = :locale, _ = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/extensions/concerns/simple_form_form_builder_extensions.rb', line 18

def locale_input(attribute_name = :locale, _ = {})
  input_options = {
    collection: I18n.available_locales,
    as: :radio_buttons,
    item_label_class: 'radio-inline',
    item_wrapper_tag: false
  }

  input attribute_name, input_options
end