1
0
Fork 0

Merge branch 'atomaka/feature/type-on-card-index' into 'master'

Add type and rarity to card index



See merge request !27
This commit is contained in:
Andrew Tomaka 2015-11-09 12:50:37 -05:00
commit 97bf360353
2 changed files with 8 additions and 3 deletions

View File

@ -3,7 +3,10 @@ class Admin::CardsController < Admin::BaseController
after_action :verify_authorized
def index
@cards = Card.includes(:character).all.order(updated_at: :desc)
@cards = Card
.includes(:character, :type, :rarity)
.all
.order(updated_at: :desc)
authorize Card
end

View File

@ -11,14 +11,16 @@
tr
th Name
th Title
th Updated
th Type
th Rarity
th Actions
tbody
- @cards.each do |card|
tr
td= card.name
td= card.title
td= card.updated_at
td= card.type.name
td= card.rarity.name
td
- if policy(:card).edit?
= link_to glyph('edit', classes: 'control-icon'), edit_admin_card_path(card)