Class: ImagePreviewInput

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

Instance Method Summary collapse

Instance Method Details

#inputObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/inputs/image_preview_input.rb', line 3

def input
  resize = options.delete(:size) || '350x100>'
  size = resize.sub(/\D$/,'')
  
  template.render("simple_dragonfly_preview/image/form", 
    f: @builder, 
    attribute_name: attribute_name.to_s, 
    retained_id: (@builder.lookup_model_names + ["retained", attribute_name.to_s]).join("_"), 
    image_id: (@builder.lookup_model_names + [attribute_name.to_s, "preview"]).join("_"),
    size: size, 
    resize: resize )
end