This is a Rails Engine that provides category management to a Rails Application. It uses the ancestry gem to allow users to create categories within categories.
In your Rails project:
- Add category_tree to the Gemfile:
gem 'category_tree', :path => '/path/to/category_tree' - Run
bundle install - Edit config/routes.rb and add this line:
mount CategoryTree::Engine => "/" - The engine contains migrations for the
categoriestable which needed to be created in the application's database. To copy these migrations:rake category_tree:install:migrations- If you want to run migrations only from the engine, specify the scope:
rake db:migrate SCOPE=category_tree
- If you want to run migrations only from the engine, specify the scope:
The engine can also migrate the view files and assets for customization. To copy them to the parent application:
rails generate category_tree:views
The engine can also migrate the controller files for customization. To copy them to the parent application:
rails generate category_tree:controllers
You can view the routes via: rake routes.
You can run a sample application with the engine within the project:
- Go to
spec/test_app - Run
rails server