Sha256: d693ff012246908cf323adbfca90a946710da7073b37528858a9dd64dbe1d7d8
Contents?: true
Size: 1.1 KB
Versions: 48
Compression:
Stored size: 1.1 KB
Contents
unless <%= singular_table_name %>.new_record? json.set! 'DT_RowId', "<%= singular_table_name %>_#{<%= singular_table_name %>.id}" json.set! 'DT_Path', <%= singular_table_name %>_path(<%= singular_table_name %>) if <%= singular_table_name %>.destroyed? json.set! 'DT_RowAction', 'remove' end end <%- attributes.reject(&:password_digest?).each do |attribute| -%> <%- if attribute.type == :references -%> json.set! '<%= attribute.name %>', h(<%= singular_table_name %>.<%= attribute.name %>.to_s) <%- elsif attribute.type == :datetime || attribute.type == :time -%> json.set! '<%= attribute.name %>', <%= singular_table_name %>.<%= attribute.name %>&.utc&.strftime('%m/%d/%Y %H:%M:%S') <%- elsif attribute.type == :date -%> json.set! '<%= attribute.name %>', <%= singular_table_name %>.<%= attribute.name %>&.strftime('%m/%d/%Y') <%- elsif attribute.type == :string || attribute.type == :text -%> json.set! '<%= attribute.name %>', h(<%= singular_table_name %>.<%= attribute.name %>) <%- else -%> json.set! '<%= attribute.name %>', <%= singular_table_name %>.<%= attribute.name %> <%- end -%> <%- end -%>
Version data entries
48 entries across 48 versions & 1 rubygems