This extension adds a hidden
field to Spree::Taxon
and hides taxons with hidden == true
from the default menus. It also shows an additional "Hidden" checkbox in the admin panel.
This is a reimplementation of the great work done by @markalinn updated for Spree 3.1+
- Add this extension to your Gemfile with this line:
gem 'spree_hideable_taxons', github: 'theam/spree_hideable_taxons', branch: 'X-Y-stable'
(Replace X-Y-stable
with the version of Spree you're using)
- Install the gem using Bundler:
bundle install
- Copy & run migrations
bundle exec rails g spree_hideable_taxons:install
- Restart your server
If your server was running, restart it so that it can find the assets properly.
- Add tests for:
- Check that the admin controller saves the
hidden
field - Check that a taxonomy is not shown when its root taxon is hidden
- Check that a taxon is not shown when it's hidden
- Check that the admin controller saves the
- Current implementation extends the
Spree::FrontendHelper
module, which is not the best for extensibility. I think that helper should be transformed in a partial in Spree so it can be extended viaDeface
. - Check compatibility with Spree 3.2.0+
First bundle your dependencies, then run rake
. rake
will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app
.
bundle
bundle exec rake
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_hideable_taxons/factories'
Follow the classical "Thanks for being awesome methodology": Fork, improve and send your pull requests!
Copyright (c) 2017 The Agile Monkeys, released under the New BSD License