Tag: 狂欢

如何在Spree 2.x / Rails 4中覆盖product_url以使SEO更友好?

我希望我的产品url看起来像: /product-name-here/p 代替: /product/product-name-here 我怎样才能做到这一点?

Spree的问题

我正在尝试按照Spree 入门中提到的步骤在我的本地计算机上安装和运行Spree 但是,当我启动服务器时,我收到以下错误: 找不到表’页’ 有人可以帮我解决这个问题吗?

如何从主应用程序访问Rails引擎方法?

我正在尝试使用Spree :: Core引擎中定义的current_order方法: https : //github.com/spree/spree/blob/master/core/lib/spree/core/current_order.rb 在我看来,我已经尝试过了 Spree::Core::CurrentOrder.current_order 在开发中仅使用“current_order”工作正常,但不在生产中。 那么我试图在我的视图文件中要求它像这样: require ‘spree/core/current_order’ 我也尝试过这些其他解决方案的排列: 如何在主应用程序中合并Rails引擎ApplicationController方法? 一种从引擎到应用程序添加before_filter的方法 Rails 3.1:在客户端应用程序中公开引擎助手的更好方法 但我已经忘记了我实际做了什么。 有人可以指出我正确的方向吗? 也许我错误地在上面的链接中实现了解决方案? 这是我在制作中遇到的错误: 2012-06-21T09:59:08 + 00:00 app [web.1]:ActionView :: Template :: Error(Spree :: Core :: CurrentOrder:Module的未定义方法`current_order’): 如果我用current_order注释掉代码行,那么一切都在生产中。 我认为这是生产中装载的方式吗? 但这是我第一次尝试部署,所以我不太了解开发和生产之间的差异。 提前致谢!

为已安装的Rails引擎设置default_url_options

使用rails 3.2.13和spree 2.0.2 我在动态范围内遇到了与Rails可安装引擎类似的问题 我的路线: scope ‘:locale’, locale: /en|jp/ do mount Spree::Core::Engine, at: ‘/store’ root to: ‘home#index’ end 我想输出更改区域设置的链接: 但这输出: JP 而不是预期的: JP – 编辑 – 当我把它放到ApplicationController : def default_url_options(options={}) { locale: I18n.locale } end 它在商店中设置语言环境参数两次而不是合并它们: http://localhost:3000/en/store/products/bag?locale=en

如何使用Spree在开发中发送电子邮件

我在开发环境中,我想通过我的控制台发送测试电子邮件。 我让控制台运行良好,但它没有发送。 我去Spree的邮件方法设置,这是我得到的: 我已经仔细检查了密码。 我用谷歌搜索了它。 我无法弄清楚如何使这个东西工作。 关键问题:如何从开发环境中获取Spree中的电子邮件? 我尝试的事情 : 狂欢邮件方法不起作用?

Spree :: Admin :: ImagesController #create中的Paperclip :: NotIdentifiedByImageMagickError

我试图第一次设置Spree。 一切顺利,直到我上传图片。 我在Mac OSX Mountain Lion上使用自制程序安装了Imageamgick。 上传任何图像会给我以下错误。 Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create Command :: identify -format %wx%h :file [paperclip] An error was received while processing: # Paperclip::NotIdentifiedByImageMagickError (/var/folders/fq/9g_6hmg513g6137rb6sbghw00000gn/T/stream20121005-26943-16883d4.png is not recognized by the ‘identify’ command.): paperclip (2.7.1) lib/paperclip/geometry.rb:29:in `from_file’ spree_core (1.2.0) app/models/spree/image.rb:35:in `find_dimensions’ activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__1794851703999987262__post_process__1580526166879208018__callbacks’ 当我从命令行运行识别时,我得到以下输出 Image Settings: -alpha option on, activate, off, deactivate, set, […]

向Rails的狂欢电子商务添加路由

我刚刚升级到1.0.3 ,我的config / routes文件夹中的routes.rb文件似乎忽略了我的所有自定义路由。 我的routes.rb JollyStore::Application.routes.draw do # Mount Spree’s routes mount Spree::Core::Engine, :at => ‘/’ root :to => ‘pages#index’ namespace :admin do resources :wysiwygs end match ‘about_us/’, :to => “pages#about_us” match ‘services/’, :to => “pages#services” match ‘raw_resources/’, :to => “pages#raw_resources” match ‘contact_us/’, :to => “pages#contact_us” match ‘privacy_policy/’, :to => “pages#privacy_policy” match ‘return_policy/’, :to => […]

如何覆盖在Ruby on Rails狂欢商务应用程序中导致问题的文件?

从Rails 3更新到Rails 4并为Spree安装Bootstrap gem后,我在app/views/spree/products/_image.html.erb收到错误。 单击主页上产品的图像后,页面如下所示: NameError in Spree::Products#show Showing []/ruby/1.9.1/bundler /gems/spree_bootstrap-a529d6bb6db0/app/views/spree/products/_image.html.erb where line #1 raised: undefined local variable or method `image’ for #<#:0x000000068d7da8> Extracted source (around line #1): 1 2 3 4 “image” %> “image”) %> Trace of template inclusion: []app/views/spree/products/show.html.erb Rails.root: []/rails/releases/20140118194836 我知道这可以通过更改破坏它的文件来解决,只包含 “image”) %> 。 我了解到如果我想让它们改变,我需要覆盖文件。 所以我想在那里更改代码,我在本地添加了一个具有相同路径和名称的文件( app/views/spree/products/_image.html.erb )和所需的新代码。 然后我部署了它,当我进入服务器时,我看到了文件。 但在网站上我仍然得到同样的错误。 由于模板包含的痕迹说它来自app/views/spree/products/show.html.erb我也将该文件更改为它,但我仍然在服务器上看到相同的代码。 我该如何解决?

狂欢安装错误:“rails g spree:install –user_class = Spree :: User”没有做任何事情

我使用此命令创建了一个新的rails应用程序: rails new store rails版本是:4.2.6 Ruby版本: $rvm rubies ruby-2.1.2 [ x86_64 ] ruby-2.2.0 [ x86_64 ] =* ruby-2.2.2 [ x86_64 ]` 以下是Gemfile: source ‘https://rubygems.org’ # Bundle edge Rails instead: gem ‘rails’, github: ‘rails/rails’ gem ‘rails’, ‘~> 4.2.6’ # Use sqlite3 as the database for Active Record gem ‘sqlite3’ # Use Puma as the app server […]

如何在Capistrano部署中将我的产品图像符号链接到生产中?

在这里,我收到了一个问题的解决方案,每当我使用Capistrano部署我的Spree Commerce应用程序时,我的图像被删除(它们仍然存在,但文件夹名称错误),我必须通过管理员再次添加它们。 在这个Google小组和问题的答案中 ,都说symlinking是解决方案。 您需要确保从Capistrano共享目录中符号链接RAILS_ROOT / public / spree目录,而不是每次部署时都重新创建。 如果未发生此符号链接,则每次部署时图像都将丢失。 我尝试了一些东西,但我没有设法将符号链接到我的图像。 在服务器上,它们位于文件夹/ p​​ublic / spree / products中。 我试过的是这个: namespace :deploy do task :start do ; end task :stop do ; end task :symlink_shared do run “ln -nfs #{shared_path}/shared/spree/ #{release_path}/public/spree/”” end end 但这不起作用。 我不知道我必须输入哪条共享路径。 我希望有人可以帮助我或提供解释链接。