Class: SimpleFormFancyUploads::ImagePreviewInput

Inherits:
SimpleForm::Inputs::FileInput
  • Object
show all
Defined in:
lib/simple_form_fancy_uploads/image_preview_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/simple_form_fancy_uploads/image_preview_input.rb', line 3

def input(wrapper_options=nil)
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)

  url = preview_url(merged_input_options)

  out = ''
  out << template.image_tag(url) if url
  out << @builder.input("#{attribute_name}_cache", as: 'hidden')
  (out << super).html_safe
end