Sha256: e040741a7f0af13724fbf0a30b65c5384ff26520c8eae4640eb4ae90dd6b3c63

Contents?: true

Size: 589 Bytes

Versions: 16

Compression:

Stored size: 589 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 -%>
end
<% end -%>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jsonapi_compliable-0.10.3 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.10.2 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.10.1 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.10.0 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.9.2 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.9.1 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.9.0 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.8.0 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.9 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.8 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.7 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.6 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.5 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.4 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.3 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.7.2 lib/generators/jsonapi/templates/serializer.rb.erb