created subcategories
This commit is contained in:
5
app/controllers/sub_categories_controller.rb
Normal file
5
app/controllers/sub_categories_controller.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class SubCategoriesController < ApplicationController
|
||||
active_scaffold :"sub_category" do |conf|
|
||||
conf.columns = [:name]
|
||||
end
|
||||
end
|
||||
2
app/helpers/sub_categories_helper.rb
Normal file
2
app/helpers/sub_categories_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module SubCategoriesHelper
|
||||
end
|
||||
@@ -1,2 +1,3 @@
|
||||
class Category < ActiveRecord::Base
|
||||
has_many :sub_categories
|
||||
end
|
||||
|
||||
3
app/models/sub_category.rb
Normal file
3
app/models/sub_category.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class SubCategory < ActiveRecord::Base
|
||||
belongs_to :category
|
||||
end
|
||||
Reference in New Issue
Block a user