parent
9558aa05ec
commit
4bad7d013c
@ -0,0 +1,6 @@
|
||||
class AdminController < ApplicationController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
@ -1,6 +1,9 @@
|
||||
class Category < ApplicationRecord
|
||||
has_many :questions
|
||||
|
||||
has_many :questions
|
||||
belongs_to :parent_categories, class_name: 'Category', foreign_key: :parent_category_id
|
||||
has_many :child_categories, class_name: 'Category', foreign_key: :parent_category_id
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
end
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
%p= link_to 'Categories', categories_path
|
||||
|
||||
%p= link_to 'Questions', questions_path
|
||||
Loading…
Reference in new issue