Module: Plugins::DropzoneHelper
- Defined in:
- app/helpers/plugins/dropzone_helper.rb
Instance Method Summary collapse
Instance Method Details
#dropzone_depiction_form(object) ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/helpers/plugins/dropzone_helper.rb', line 11 def dropzone_depiction_form(object) if object.respond_to?(:depictions) && !object.class.name == 'Image' form_tag(depictions_path, method: :post, authenticity_token: form_authenticity_token, class: :dropzone, id: 'depiction-images') do hidden_field_tag('depiction[depiction_object_type]', object.class.name ).html_safe + hidden_field_tag('depiction[depiction_object_id]', object.id.to_s).html_safe end end end |
#dropzone_form(image = nil) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/plugins/dropzone_helper.rb', line 3 def dropzone_form(image = nil) if image.new_record? form_tag( images_path, method: :post, authenticity_token: form_authenticity_token, class: :dropzone, id: 'basic-images') else form_tag( image_path(image), method: :patch, authenticity_token: form_authenticity_token, class: :dropzone, id: 'basic-images') end end |