Reputation: 4675
I have installed Spree on a Windows machine, added sample data and accessed the admin.
But now what?
How do I create a new page or URL?
I don't find any controllers or files in my rails project folder. Do I have to change the location where Spree is downloaded?
Upvotes: 5
Views: 4096
Reputation: 2046
But now what?
Spree is "developer friendly", which means you'll need to use the developers mindset as you're building your application. To create a new page, you'll have to follow the Rails-Way. If you run bin/rake routes
you'll see all of the routes generated for you.
To generate a path in Spree, you need to call something like spree.root_path
. If you have the same path named in your main application, then you'll have to call main_app.root_path
. This way rails knows you want your own root path, not Spree's.
For some best practices, you should checkout this blog post: http://blog.benmorgan.io/post/102924399166/customizing-spree-some-best-practices. (My blog also has a lot of Spree content in it.)
I don't find any controllers or files in my rails project folder. Do I have to modify the location where the spree is downloaded?
Bundler installs Spree which is then stored via rvm or rbenv in its appropriate location. All you have to do is add:
gem 'spree', github: 'spree', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
Or you could use Solidus which I'm now using instead of Spree; currently moving all active Spree projects over to this one.
What I recommend:
Spree::Order
object should be quite simple. Then its just Spree::Order.next!
and you can start checking things out. To add products to an order, you just order.contents.add Spree::Variant.first, 1
and you've got a new line item in the DB.Upvotes: 4