Class: CompositeInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
app/inputs/composite_input.rb

Overview

Render Something Like This

<div class=“control-group composite optional foo_bar”>


  
  

</div>

Instance Method Summary collapse

Instance Method Details

#inputObject



19
20
21
22
23
24
25
# File 'app/inputs/composite_input.rb', line 19

def input
  input_html_classes.unshift("string")
  input_html_options[:type] ||= 'text'
  input_html_options[:name] ||= "#{object_name}[#{attribute_name}]"
  markup = ""
  markup << field_wrapper_for('', nil)
end

#labelObject



27
28
29
30
31
# File 'app/inputs/composite_input.rb', line 27

def label
  options[:elements].each_with_object('') {|element_name, html|
    html << element_label(element_name)
  }
end