Resting Pug logo Resting Pug

Description

Creates a subject with attributes from params and returns it

Example

Request:
POST http://your.awesome/api/books
{
  "name": "11/22/63",
  "author": "Stephen King"
}

Response:
200 OK
{
  "book": {
    "id": 1,
    "name": "11/22/63",
    "author": "Stephen King"
  }
}

How to customize

Use

Source code

# lib/resting_pug/actions.rb

def create
  run_chain(create_chain)
end
Find me on GitHub