Spree category pages in custom rails app

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:54:25

问题


I have created a default rails app. I am beginner to spree.

I am not able to find the code for the pages which are coming by default in the spree app.

This is how I have created the app

gem install rails -v 4.2.2
gem install bundler
gem install spree_cmd
rails _4.2.2_ new mystore
cd mystore
spree install --auto-accept

When I go to http://localhost:3000/t/categories/bags I get all the categories for this category.

But in my view I do not see any code. So from where are these coming from?

Please help.


回答1:


it is coming from spree gems, you can see the front end code by opening the gem file in your editor by following. (you need to set you environment variables EDITOR or BUNDLER_EDITOR)

bundle open spree_frontend 

or else you can do in terminal

bundle show spree_frontend
open 'path above something like  /Users/xyz/.rvm/gems/ruby-2.2.3/gems/spree_frontend-3.0.8'



回答2:


These pages come from within the Spree gem, which adds routes and views. Have a poke around and see what you find here: https://github.com/spree/spree/tree/master/core/app

It runs as a Rails engine, so read up on how that works here if you want to know how the gem adds routes: http://guides.rubyonrails.org/engines.html




回答3:


See rails request/response log to find the rendered partials path in a request.

Also you may find http://guides.spreecommerce.com/developer/view.html helpful.



来源:https://stackoverflow.com/questions/36282646/spree-category-pages-in-custom-rails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!