Class: Interview::NestedFormAddImages
- Defined in:
- lib/interview/nested_form_add_images.rb
Instance Attribute Summary collapse
-
#style ⇒ Object
Returns the value of attribute style.
Attributes inherited from Control
Instance Method Summary collapse
Methods inherited from Control
#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #set_attributes, #set_defaults
Constructor Details
This class inherits a constructor from Interview::Control
Instance Attribute Details
#style ⇒ Object
Returns the value of attribute style.
4 5 6 |
# File 'lib/interview/nested_form_add_images.rb', line 4 def style @style end |
Instance Method Details
#render ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/interview/nested_form_add_images.rb', line 6 def render if @style and @style.to_sym == :horizontal_form html = Builder::XmlMarkup.new # todo: in eigenes Objekt auslagern? html.div class: 'row' do html.div class: 'col-xs-9 col-xs-offset-3' do html << render_link end end return html.target! else return render_link end end |
#render_link ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/interview/nested_form_add_images.rb', line 20 def render_link html = Builder::XmlMarkup.new html.div class: "clearfix" do html.span class: "btn btn-default fileinput-button" do html.span "Bilder hinzufügen" # todo html << h.file_field_tag("upload_buffer[attachment]", class: 'nested_form_add_images', multiple: true, data: {url: "/upload_buffers.json", type: 'POST'}) end end return html.target! end |