I want to show index of cards by using Angular.js and Rails.

This is my code.

```
# app/views/decks/show.html.erb
<div ng-controller="DeckCtrl">
  <form ng-submit="addCard()">
    <input type="text" ng-model="newCard.front" />
    <input type="submit" value="Add">
  </form>
  {{newCard.front}}
  <ul>
    <li ng-repeat="card in cards">
      {{card.front}}
    </li>
  </ul>
</div>

```

And coffee script

```
# app/assets/javascripts/decks.js.coffee
app = angular.module("Deck", ["ngResource"])

@DeckCtrl = ($scope, $resource) ->
  Card = $resource("/cards/:id", {id: "@id"}, {update: {method: "PUT"}})
  $scope.cards = Card.query()

  $scope.addCard = ->
    $scope.cards.push($scope.newCard)
    $scope.newCard = {}

```

And `CardsController`.

```
class CardsController < ApplicationController
  respond_to :json
  def index
    respond_with Card.all
  end

  def show
    respond_with Card.find(params[:id])
  end

  def create
    respond_with Card.create(card_params)
  end

  def update
    respond_with Card.update(params[:id], card_params)
  end

  def destroy
    respond_with_Card.destroy(params[:id])
  end

  private
    # Never trust parameters from the scary internet, only allow the white list through.
    def card_params
      params.require(:card).permit(:front, :back, :tips, :cardtype, :deck_id, :box_number)
    end
end

```

the `addCard` function is working, but `Card.query()` give me this error.

```
Started GET "/cards" for 127.0.0.1 at 2014-04-17 10:39:42 +0900
Processing by CardsController#index as HTML
Completed 406 Not Acceptable in 2ms

ActionController::UnknownFormat - ActionController::UnknownFormat:

```

It looks like `Angular.js` sends `HTML` not `json`, that causes error, is that right?
How can I remove this error?