好吧,我一直在尝试按照本教程更改大礼包的默认主题
Well, I've been trying to change the default theme of spree by following this tutorial
blog.endpoint/2010/01/rails-ecommerce-spree-hooks-tutorial.html
但是首页完全没有改变,由于本教程是针对Rails 2的,我只是想知道我需要从教程使其与Rails 3兼容?
But the homepage doesn't change at all, well since the tutorial is meant for rails 2, I'm just wondering what do I need to change from the tutorial to make it work with rails 3?
比使用钩子更简单的解决方案受到欢迎。同样,在我使用它的同时,还有一种方法可以撤消您在rails中运行的命令,例如卸载扩展。
Simpler solution than using hooks is welcomed. Also while I'm at it, is there a way to undo the command you run in rails like maybe uninstalling an extension.
推荐答案
如果您的html没什么不同(我的在 daugpigiau.lt ),您可能只能使用挂钩并覆盖某些部分。我仍然知道钩子名称的唯一方法就是查看那些对我来说很有趣的狂欢核心宝石和模板。知道您感兴趣的钩子之后,您可以执行以下操作:
If your html is not that different (mine is quite different at daugpigiau.lt) from default spree shop you might be able to only use hooks and override some of the parts. Still the only way I've found to know hook names was to look inside those spree core gems and templates that were interesting for me. After you know what hooks are of interest to you you can do something like:
class PigiauHooks < Spree::ThemeSupport::HookListener # custom hooks go here insert_after :admin_inside_head, 'shared/admin/ckeditor_include' insert_before :admin_product_form_meta, 'shared/admin/product_editor' insert_before :admin_product_form_additional_fields, 'shared/admin/unavailable_on' end这些只是我自己的
起初我一直在努力处理最重要的部分,这是因为该文档上的空白太多,以至于第一次使用的用户都无法掌握。
I've strugled with the overriding part at first cause documentation on this one has a bit too much blank spaces for the first time user to grasp.
更多推荐
狂欢,Rails 3和主题
发布评论