1
0
Fork 0
dokkan-data-rails/app/controllers/api/v1/cards_controller.rb

22 lines
549 B
Ruby
Raw Normal View History

class Api::V1::CardsController < Api::V1::BaseController
before_action :set_card, only: [:show]
def index
2015-11-03 13:24:10 -05:00
@cards = Card.includes(:character, :rarity, :type, :leader_skill,
:passive_skill, :super_attack, :awaken_type,
:dokkan_card, :hp_stat, :atk_stat, :def_stat,
:links).all.order(:gameid)
2015-11-03 12:04:58 -05:00
render json: @cards, root: false
end
def show
render json: @card, root: false
end
private
def set_card
@card = Card.find(params[:id])
end
end