Module: Croppable::TagHelper

Defined in:
app/helpers/croppable/tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#croppable_field_tag(name, method, value, object, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/croppable/tag_helper.rb', line 3

def croppable_field_tag(name, method, value, object, options = {})
  width  = options["width"]  || object.send("#{ method }_croppable_setup")[:width]
  height = options["height"] || object.send("#{ method }_croppable_setup")[:height]

  original = object.send(:"#{ method }_original")
  data     = object.send(:"#{ method }_croppable_data")

  render "croppable/tag", width: width, height: height, method: method, name: name,
    original: original, data: data
end