Sha256: 004abb0a130a804ee75075a0dc7b6a58383aeab9f4e6408a9243c926719d75d6

Contents?: true

Size: 540 Bytes

Versions: 165

Compression:

Stored size: 540 Bytes

Contents

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

def file_field_show(object, attribute)
  o = object.send(attribute)
  msg = o.to_s
  if o.send(:present?)
    msg = "<a href='#{o.send(:url)}'>#{o.send(:path).gsub(/^.*\//,'')}</a>".html_safe
  end
  link_to_inline_edit object, attribute, msg
end

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

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

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
inline_forms-3.1.1 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.1.0 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.58 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.57 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.56 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.55 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.54 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.53 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.52 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.51 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.50 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.49 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.48 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.47 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.46 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.45 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.44 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.43 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.42 lib/app/helpers/form_elements/file_field.rb
inline_forms-3.0.41 lib/app/helpers/form_elements/file_field.rb