Add type and rarity to card index
This commit is contained in:
parent
c16b1dcb4f
commit
6f3957a0b2
2 changed files with 8 additions and 3 deletions
|
@ -3,7 +3,10 @@ class Admin::CardsController < Admin::BaseController
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@cards = Card.includes(:character).all.order(updated_at: :desc)
|
@cards = Card
|
||||||
|
.includes(:character, :type, :rarity)
|
||||||
|
.all
|
||||||
|
.order(updated_at: :desc)
|
||||||
|
|
||||||
authorize Card
|
authorize Card
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,14 +11,16 @@
|
||||||
tr
|
tr
|
||||||
th Name
|
th Name
|
||||||
th Title
|
th Title
|
||||||
th Updated
|
th Type
|
||||||
|
th Rarity
|
||||||
th Actions
|
th Actions
|
||||||
tbody
|
tbody
|
||||||
- @cards.each do |card|
|
- @cards.each do |card|
|
||||||
tr
|
tr
|
||||||
td= card.name
|
td= card.name
|
||||||
td= card.title
|
td= card.title
|
||||||
td= card.updated_at
|
td= card.type.name
|
||||||
|
td= card.rarity.name
|
||||||
td
|
td
|
||||||
- if policy(:card).edit?
|
- if policy(:card).edit?
|
||||||
= link_to glyph('edit', classes: 'control-icon'), edit_admin_card_path(card)
|
= link_to glyph('edit', classes: 'control-icon'), edit_admin_card_path(card)
|
||||||
|
|
Loading…
Reference in a new issue