Spree Pages
Simplified version of spree_static_pages without localisation overhead
Installation
Add this extension to your Gemfile with this line:
gem 'spree_pages', github: 'public-market/spree_pages'Install the gem using Bundler:
bundle installCopy & run migrations
bundle exec rails g spree_pages:installRestart your server
If your server was running, restart it so that it can find the assets properly.
Adding WYSIWYG (example: ckeditor)
Install ckeditor:
Add ckeditor to js:
In our case it's
vendor/assets/javascripts/spree/backend/all.jsAdd this line before
//= require_tree .//= require ckeditor/initAdd ckeditor to necessary fields in forms:
Create new js file
ckeditorInit.jsinvendor/assets/javascripts/spree/backend$(function() { var editableIds = ['page_content'] editableIds.forEach(function(id) { if ($("#" + id).length) { CKEDITOR.replace(id); } }) });This script will add ckeditor to all fields with ids from
editableIdsarray. In this case it'spage_content
Testing
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
Contributing
If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.
Copyright (c) 2018 Abundance Labs, Inc., released under the New BSD License