Sha256: 445a9ef859eb392a40d7b8b8b82cde08630b678957f17afc8db4287a896dd829

Contents?: true

Size: 567 Bytes

Versions: 29

Compression:

Stored size: 567 Bytes

Contents

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

def text_field_show(object, attribute)
  link_to_inline_edit object, attribute, (object[attribute].nil? || object[attribute].empty?) ? "<i class='fi-plus'></i>".html_safe : object[attribute]
end

def text_field_edit(object, attribute)
  text_field_tag attribute, (object.send attribute.to_sym), :class => 'input_text_field'  # for abide: , :required => true
end

def text_field_update(object, attribute)
  object.send :write_attribute, attribute.to_sym, params[attribute.to_sym]
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
inline_forms-3.0.9 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.8 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.7 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.6 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.5 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.4 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.3 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.2 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0.1 lib/app/helpers/form_elements/text_field.rb
inline_forms-3.0 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.70 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.69 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.68 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.67 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.66 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.65 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.64 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.63 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.62 lib/app/helpers/form_elements/text_field.rb
inline_forms-1.6.61 lib/app/helpers/form_elements/text_field.rb