Genres


GET /api/demo/genres
HTTP 200 OK
{
  "count": 5,
  "page": 1,
  "page_size": 30,
  "total_pages": 1,
  "results": [
    {
      "id": 1,
      "name": "Action",
      "description": "Action movies are fast-paced and exciting.",
      "movies": [

      ],
      "movies.count": 0,
      "main_movies": [
        {
          "id": 1,
          "name": "Star Wars IV: A New Hope"
        },
        {
          "id": 2,
          "name": "The Dark Knight"
        },
        {
          "id": 4,
          "name": "The Matrix"
        },
        {
          "id": 5,
          "name": "The Avengers"
        }
      ],
      "main_movies.count": 4
    },
    {
      "id": 2,
      "name": "Comedy",
      "description": "Comedy movies are funny.",
      "movies": [

      ],
      "movies.count": 0,
      "main_movies": [

      ],
      "main_movies.count": 0
    },
    {
      "id": 3,
      "name": "Drama",
      "description": "Drama movies are serious.",
      "movies": [

      ],
      "movies.count": 0,
      "main_movies": [

      ],
      "main_movies.count": 0
    },
    {
      "id": 4,
      "name": "Fantasy",
      "description": "Fantasy movies are magical.",
      "movies": [

      ],
      "movies.count": 0,
      "main_movies": [
        {
          "id": 6,
          "name": "Inception"
        }
      ],
      "main_movies.count": 1
    },
    {
      "id": 5,
      "name": "Adventure",
      "description": "Adventure movies are exciting.",
      "movies": [

      ],
      "movies.count": 0,
      "main_movies": [
        {
          "id": 3,
          "name": "The Lord of the Rings: The Fellowship of the Ring"
        }
      ],
      "main_movies.count": 1
    }
  ]
}
<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <count type="integer">5</count>
  <page type="integer">1</page>
  <page-size type="integer">30</page-size>
  <total-pages type="integer">1</total-pages>
  <results type="array">
    <result>
      <id type="integer">1</id>
      <name>Action</name>
      <description>Action movies are fast-paced and exciting.</description>
      <movies type="array"/>
      <movies.count type="integer">0</movies.count>
      <main-movies type="array">
        <main-movie>
          <id type="integer">1</id>
          <name>Star Wars IV: A New Hope</name>
        </main-movie>
        <main-movie>
          <id type="integer">2</id>
          <name>The Dark Knight</name>
        </main-movie>
        <main-movie>
          <id type="integer">4</id>
          <name>The Matrix</name>
        </main-movie>
        <main-movie>
          <id type="integer">5</id>
          <name>The Avengers</name>
        </main-movie>
      </main-movies>
      <main-movies.count type="integer">4</main-movies.count>
    </result>
    <result>
      <id type="integer">2</id>
      <name>Comedy</name>
      <description>Comedy movies are funny.</description>
      <movies type="array"/>
      <movies.count type="integer">0</movies.count>
      <main-movies type="array"/>
      <main-movies.count type="integer">0</main-movies.count>
    </result>
    <result>
      <id type="integer">3</id>
      <name>Drama</name>
      <description>Drama movies are serious.</description>
      <movies type="array"/>
      <movies.count type="integer">0</movies.count>
      <main-movies type="array"/>
      <main-movies.count type="integer">0</main-movies.count>
    </result>
    <result>
      <id type="integer">4</id>
      <name>Fantasy</name>
      <description>Fantasy movies are magical.</description>
      <movies type="array"/>
      <movies.count type="integer">0</movies.count>
      <main-movies type="array">
        <main-movie>
          <id type="integer">6</id>
          <name>Inception</name>
        </main-movie>
      </main-movies>
      <main-movies.count type="integer">1</main-movies.count>
    </result>
    <result>
      <id type="integer">5</id>
      <name>Adventure</name>
      <description>Adventure movies are exciting.</description>
      <movies type="array"/>
      <movies.count type="integer">0</movies.count>
      <main-movies type="array">
        <main-movie>
          <id type="integer">3</id>
          <name>The Lord of the Rings: The Fellowship of the Ring</name>
        </main-movie>
      </main-movies>
      <main-movies.count type="integer">1</main-movies.count>
    </result>
  </results>
</hash>
Path Verb Controller#Action
genres GET api/demo/genres#index
genres POST api/demo/genres#create
genres PUT api/demo/genres#update_all
genres PATCH api/demo/genres#update_all
genres DELETE api/demo/genres#destroy_all
genres OPTIONS api/demo/genres#options
genres/:id GET api/demo/genres#show
genres/:id PUT api/demo/genres#update
genres/:id PATCH api/demo/genres#update
genres/:id DELETE api/demo/genres#destroy