Allow verification checkbox for cards
This commit is contained in:
parent
caf7178189
commit
4e78901739
4 changed files with 13 additions and 25 deletions
|
@ -61,7 +61,7 @@ class Admin::CardsController < Admin::BaseController
|
||||||
|
|
||||||
def card_params
|
def card_params
|
||||||
params.require(:card).permit(:title, :character_id, :rarity_id, :type_id,
|
params.require(:card).permit(:title, :character_id, :rarity_id, :type_id,
|
||||||
:leader_skill_id, :passive_skill_id,
|
:leader_skill_id, :passive_skill_id, :verified,
|
||||||
:super_attack_id, :dokkan_id, :gameid,
|
:super_attack_id, :dokkan_id, :gameid,
|
||||||
:awaken_type_id, :dokkan_id, link_ids: [])
|
:awaken_type_id, :dokkan_id, link_ids: [])
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,5 +30,9 @@
|
||||||
= f.label :links
|
= f.label :links
|
||||||
div
|
div
|
||||||
= f.association :links, as: :check_boxes, item_wrapper_tag: nil, item_label_class: 'checkbox-inline', label: false
|
= f.association :links, as: :check_boxes, item_wrapper_tag: nil, item_label_class: 'checkbox-inline', label: false
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= f.label 'Verification'
|
||||||
|
= f.input :verified, as: :boolean, item_wrapper_tag: nil, item_label_class: 'checkbox-inline'
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.button :button
|
= f.button :button
|
||||||
|
|
5
db/migrate/20151014143908_add_verified_to_cards.rb
Normal file
5
db/migrate/20151014143908_add_verified_to_cards.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddVerifiedToCards < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :cards, :verified, :bool, default: false
|
||||||
|
end
|
||||||
|
end
|
27
db/schema.rb
27
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20151014121824) do
|
ActiveRecord::Schema.define(version: 20151014143908) do
|
||||||
|
|
||||||
create_table "awaken_types", force: :cascade do |t|
|
create_table "awaken_types", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
|
@ -19,29 +19,8 @@ ActiveRecord::Schema.define(version: 20151014121824) do
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "cards", force: :cascade do |t|
|
# Could not dump table "cards" because of following NoMethodError
|
||||||
t.integer "character_id"
|
# undefined method `[]' for nil:NilClass
|
||||||
t.integer "rarity_id"
|
|
||||||
t.integer "type_id"
|
|
||||||
t.integer "leader_skill_id"
|
|
||||||
t.integer "passive_skill_id"
|
|
||||||
t.integer "super_attack_id"
|
|
||||||
t.integer "dokkan_id"
|
|
||||||
t.string "title"
|
|
||||||
t.string "gameid", default: "0000000"
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "updated_at", null: false
|
|
||||||
t.integer "awaken_type_id"
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "cards", ["awaken_type_id"], name: "index_cards_on_awaken_type_id"
|
|
||||||
add_index "cards", ["character_id"], name: "index_cards_on_character_id"
|
|
||||||
add_index "cards", ["dokkan_id"], name: "index_cards_on_dokkan_id"
|
|
||||||
add_index "cards", ["leader_skill_id"], name: "index_cards_on_leader_skill_id"
|
|
||||||
add_index "cards", ["passive_skill_id"], name: "index_cards_on_passive_skill_id"
|
|
||||||
add_index "cards", ["rarity_id"], name: "index_cards_on_rarity_id"
|
|
||||||
add_index "cards", ["super_attack_id"], name: "index_cards_on_super_attack_id"
|
|
||||||
add_index "cards", ["type_id"], name: "index_cards_on_type_id"
|
|
||||||
|
|
||||||
create_table "cards_links", id: false, force: :cascade do |t|
|
create_table "cards_links", id: false, force: :cascade do |t|
|
||||||
t.integer "card_id"
|
t.integer "card_id"
|
||||||
|
|
Loading…
Reference in a new issue