Sha256: 739b14e4741260879a84eb2ce05c3738965631e063142a3585ebfabfde214641
Contents?: true
Size: 773 Bytes
Versions: 62
Compression:
Stored size: 773 Bytes
Contents
# -*- encoding : utf-8 -*- InlineForms::SPECIAL_COLUMN_TYPES[:date_select]=:date # date def date_select_show(object, attribute) link_to_inline_edit object, attribute, object.send(attribute).nil? ? "<i class='fi-plus'></i>".html_safe : object.send(attribute).to_date.strftime("%d-%m-%Y") end def date_select_edit(object, attribute) css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).to_date.strftime("%d-%m-%Y") ), :id => css_id, :class =>'datepicker' out << "<script>$('##{css_id}').datepicker();</script>".html_safe end def date_select_update(object, attribute) object[attribute.to_sym] = params[attribute.to_sym] end
Version data entries
62 entries across 62 versions & 1 rubygems