# <%= human_name.pluralize %> Endpoints: - [Get <%= human_name.pluralize.downcase %>](#get-<%= plural_name.dasherize %>) - [Get <%= human_name.downcase %>](#get-<%= singular_name.dasherize %>) - [Create <%= human_name.downcase %>](#create-<%= singular_name.dasherize %>) - [Update <%= human_name.downcase %>](#update-<%= singular_name.dasherize %>) - [Delete <%= human_name.downcase %>](#delete-<%= singular_name.dasherize %>) Models: - [<%= class_name %> model](#<%= singular_name.dasherize %>-model) ## Get <%= human_name.pluralize.downcase %> - `GET /<%= plural_name %>.json` will return a [paginated list](../README.md#pagination) of <%= human_name.pluralize.downcase %>. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the response payload. ## Get <%= human_name.downcase %> - `GET /<%= plural_name %>/1.json` will return the <%= human_name.downcase %> with an ID of `1`. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the response payload. ## Create <%= human_name.downcase %> - `POST /<%= plural_name %>.json` creates <%= human_name.downcase %>. _Optional parameters_: <% attributes.each do |attribute| -%> * `<%= attribute.column_name %>` - <%= attribute.name.humanize(capitalize: false) %> of the <%= human_name.downcase %>. <% end -%> This endpoint will return `201 Created` with the current JSON representation of the <%= human_name.downcase %> if the creation was a success. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the payload. ## Update <%= human_name.downcase %> - `PUT /<%= plural_name %>/1.json` allows changing the <%= human_name.downcase %> with an ID of `1`. You may change any of the required or optional parameters as listed in the [create <%= human_name.downcase %>](#create-<%= singular_name.dasherize %>) endpoint. This endpoint will return `200 OK` with the current JSON representation of the <%= human_name.downcase %> if the update was a success. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the payload. ## Delete <%= human_name.downcase %> - `DELETE /<%= plural_name %>/1.json` will delete the <%= human_name.downcase %> with an ID of `1`. This endpoint will return `204 No Content` if successful. No parameters are required. --- ## Models ###### <%= class_name %> model ```json { <% attributes.each do |attribute| -%> <% if attribute.password_digest? -%> "password_digest": "string", <% elsif attribute.token? -%> "<%= attribute.column_name %>": "string", <% elsif attribute.reference? -%> "<%= attribute.column_name %>": "integer", <% elsif !attribute.virtual? -%> "<%= attribute.column_name %>": "<%= attribute.type %>", <% end -%> <% end -%> "created_at": "datetime", "updated_at": "datetime" } ```