Sha256: b3d533be4bb11c10e976b213894b74cee7ab1a244dd10fe6bf06742508911ac0
Contents?: true
Size: 663 Bytes
Versions: 39
Compression:
Stored size: 663 Bytes
Contents
<%- unless omit_comments? -%> # Serializers define the rendered JSON for a model instance. # We use jsonapi-rb, which is similar to active_model_serializers. <%- end -%> <% module_namespacing do -%> class Serializable<%= class_name %> < JSONAPI::Serializable::Resource type :<%= type %> <%- unless omit_comments? -%> # Add attributes here to ensure they get rendered, .e.g. # # attribute :name # # To customize, pass a block and reference the underlying @object # being serialized: # # attribute :name do # @object.name.upcase # end <%- end -%> <%- attributes.each do |a| -%> attribute :<%= a.name %> <%- end -%> end <% end -%>
Version data entries
39 entries across 39 versions & 1 rubygems