Class: SimpleFormFancyUploads::AttachmentPreviewInput

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

Instance Method Summary collapse

Instance Method Details

#inputObject



3
4
5
6
7
8
9
# File 'lib/simple_form_fancy_uploads/attachment_preview_input.rb', line 3

def input
  out = ''
  if object.send("#{attribute_name}?")
    out << template.link_to(object.send(attribute_name).filename, object.send(attribute_name).url)
  end
  (out << super).html_safe
end