Class: TemplateEditorInput

Inherits:
SimpleForm::Inputs::TextInput
  • Object
show all
Includes:
Cms::FormBuilder::DefaultInput
Defined in:
app/inputs/template_editor_input.rb

Instance Method Summary collapse

Methods included from Cms::FormBuilder::DefaultInput

#extract_default

Instance Method Details

#input(_wrapper_options = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'app/inputs/template_editor_input.rb', line 9

def input(_wrapper_options = nil)
  if render_template_input?
    options[:default] = object.class.default_template
    options[:default_handler] = "erb" unless options[:default_handler]
    view = @builder.select "#{attribute_name}_handler", ActionView::Template.template_handler_extensions, selected: options[:default_handler]
    view << '<br />'.html_safe
    extract_default
    view << @builder.text_area(attribute_name, input_html_options).html_safe
  end
end

#label(_wrapper_options = nil) ⇒ Object



5
6
7
# File 'app/inputs/template_editor_input.rb', line 5

def label(_wrapper_options = nil)
  super if render_template_input?
end