Sha256: 943943082d59cc23d527b260ca51bd8d535b4e5608283916ef7a370d30cdf08d

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

# -*- encoding : utf-8 -*-
InlineForms::SPECIAL_COLUMN_TYPES[:integer_field]=:integer

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

def integer_field_edit(object, attribute)
  integer_field_tag attribute, (object.send attribute.to_sym), :class => 'input_integer_field'  # for abide: , :required => true
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inline_forms-1.6.60 lib/app/helpers/form_elements/integer_field.rb
inline_forms-1.6.59 lib/app/helpers/form_elements/integer_field.rb