README.md in alchemy_spree-0.2.0 vs README.md in alchemy_spree-0.3.0
- old
+ new
@@ -8,67 +8,113 @@
1. It provides an Alchemy module that displays Spree admin in an iframe inside Alchemy admin.
2. It gives you new Essences for Alchemy called EssenceSpreeProduct and EssenceSpreeTaxon that you can use to place a Spree product and Taxon on your pages.
3. Shares admin session between Alchemy and Spree.
+### Compatibility
+
+## Spree
+
+This version runs with Spreecommerce 2.1 and above.
+
+## Alchemy
+
+This version runs with Alchemy 3.0
+
## Installation
Add this line to your application's Gemfile:
- gem 'alchemy_spree'
+```ruby
+gem 'alchemy_spree', github: 'magiclabs/alchemy_spree', branch: 'master'
+```
And then execute:
- $ bundle
+```sh
+$ bundle
+```
-Or install it yourself as:
-
- $ gem install alchemy_spree
-
Install the migrations:
- $ rake alchemy_spree:install:migrations
+```sh
+$ rake alchemy_spree:install:migrations
+```
Migrate the database:
- $ rake db:migrate
+```sh
+$ rake db:migrate
+```
+### Authentication system installation
+
+Since Alchemy 3.0 has dropped the authentication from its core, you will need to choose one authentication system. The easiest choice is to use the [alchemy-devise gem](https://github.com/magiclabs/alchemy-devise).
+
+To install alchemy-devise:
+
+```ruby
+# Gemfile
+gem 'alchemy-devise', '~> 2.0'
+```
+
+And then execute:
+
+```sh
+$ bundle
+```
+
+Finally, you'll need to instruct Spree accordingly:
+
+```ruby
+# config/initializers/spree.rb
+Spree.user_class = "Alchemy::User"
+```
+
## Usage
### Create a new Element for Alchemy
- # config/alchemy/elements.yml
- - name: product
- contents:
- - name: spree_product
- type: EssenceSpreeProduct
+```yaml
+# config/alchemy/elements.yml
+- name: product
+ contents:
+ - name: spree_product
+ type: EssenceSpreeProduct
- - name: product_category
- contents:
- - name: spree_taxon
- type: EssenceSpreeTaxon
+- name: product_category
+ contents:
+ - name: spree_taxon
+ type: EssenceSpreeTaxon
+```
### Generate the views
- $ rails g alchemy:elements --skip
+```sh
+$ rails g alchemy:elements --skip
+```
### Place this element on a page layout
- # config/alchemy/page_layouts.yml
- - name: product
- elements: [product]
- - name: products
- elements: [product_category]
+```yaml
+# config/alchemy/page_layouts.yml
+- name: product
+ elements: [product]
+- name: products
+ elements: [product_category]
+```
### You can haz Spree product and taxons!
- # app/views/alchemy/elements/_product_view.html.erb
- <%= element.ingredient('spree_product') %>
+```erb
+# app/views/alchemy/elements/_product_view.html.erb
+<%= element.ingredient('spree_product') %>
- # app/views/alchemy/elements/_product_category_view.html.erb
- <%= element.ingredient('spree_taxon') %>
+# app/views/alchemy/elements/_product_category_view.html.erb
+<%= element.ingredient('spree_taxon') %>
+```
-Alchemy <3 Spree!
+Alchemy :heart: Spree!
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)