Sha256: b6e1c0436b44745ae7c58eb73a00f3742605c419ffba1170db42c754ae5dff41

Contents?: true

Size: 615 Bytes

Versions: 24

Compression:

Stored size: 615 Bytes

Contents

# -*- encoding : utf-8 -*-
InlineForms::SPECIAL_COLUMN_TYPES[:image_field]=:string

def image_field_show(object, attribute)
  o = object.send(attribute)
  msg = "<i class='fi-plus'></i>".html_safe
  if o.send(:present?)
    if o.respond_to? :palm
      msg = image_tag(o.send(:palm).send(:url))
    else
      msg = image_tag(o.send(:url))
    end
  end
  link_to_inline_edit object, attribute, msg
end

def image_field_edit(object, attribute)
  file_field_tag attribute, :class => 'input_text_field'
end

def image_field_update(object, attribute)
  object.send(attribute.to_s + '=', params[attribute.to_sym])
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
inline_forms-3.0.25 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.24 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.23 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.22 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.21 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.20 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.19 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.18 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.17 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.16 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.15 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.14 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.12 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.11 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.10 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.9 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.8 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.7 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.6 lib/app/helpers/form_elements/image_field.rb
inline_forms-3.0.5 lib/app/helpers/form_elements/image_field.rb