spree

Can not run 'rake paperclip:refresh:thumbnails CLASS=Spree::Image' in rails spree app console getting No Such Key

流过昼夜 提交于 2019-12-06 10:02:59
问题 I am trying to RAILS_ENV=production run rake paperclip:refresh:thumbnails CLASS=Spree::Image on my remote server in my current rails app directory, so I can refresh the spree images that I have uploaded in the past. I am using S3, my bucket is setup correctly as I can see each of my product's images in individual ID folders in my AWS S3 bucket. But each time I run the above command I get a 'No Such Key' Error when the rake is aborted. This command runs locally and works fine. (obviously

Extending the Spree::Product model/class

心不动则不痛 提交于 2019-12-06 04:36:01
问题 I'm using Spree in a Rails 3.2 app of mine and I want to extend Spree's Product class to better suit my needs as for example to establish a relationship with another model in my app. What's the best way to do this? I could not find anything about it in the project documentation And what if I want to add new attributes/fields to the Product resource? I can't find it's migration either :/ Thanks in advance :) 回答1: The best thing to do here is to create a product_decorator.rb in your app. This

How to access Spree's link_to_cart function from main rails app

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:12:53
问题 I am building a spree shop into an exiting Rails application, and I need to access link_to_cart from outside of the Spree engine. link_to_cart can be found here: spree/core/app/helpers/spree/base_helper.rb Since I have modified the styling in link_to_cart , I also created: #helpers/spree/base_helper_decorator.rb module Spree module BaseHelper def link_to_cart(text = nil) text = text ? h(text) : Spree.t('cart') css_class = nil if simple_current_order.nil? or simple_current_order.item_count

RSpec throws segmentation fault

你。 提交于 2019-12-05 16:29:18
sometimes my test suite throws a segmentation fault for no reasons. Here is the output: /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268: [BUG] Bus Error ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0] -- Control frame information ----------------------------------------------- c:0209 p:---- s:0839 b:0839 l:000838 d:000838 CFUNC :- c:0208 p:0068 s:0835 b:0833 l:000832 d:000832 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268 c:0207 p:0031 s:0828 b

Is there a way to check if part of the URL contains a certain string

筅森魡賤 提交于 2019-12-05 10:05:26
Is there a way to check if part of the URL contains a certain string: Eg. <% if current_spree_page?("/products/*") %> , where * could be anything? I tested, and gmacdougall's answer works, I had already found a solution though. This is what I used to render different layouts depending on what the url is: url = request.path_info if url.include?('products') render :layout => 'product_layout' else render :layout => 'layout' end The important thing to note is that different pages will call different methods within the controller (eg. show, index). What I did was put this code in its own method and

Spree how to display variants in drop down Ruby on Rails?

China☆狼群 提交于 2019-12-05 09:49:36
I'm using spree 2.0.0 stable in my application. On product show page all variants display as a radio buttons. I just want to show them in a drop down. Any thoughts on this? Thanks. Note: This solution implements Spree "Template Replacement method" especially, when u have extensive design change in your application design or using your custom design. See here http://guides.spreecommerce.com/developer/view.html Otherwise use "deface" method if u are using default design of Spree store or minor changes. Go to: app/views/spree/products/_cart.html.erb. and wrote following line at inside cart Form.

Facebook OAuth is not returning email in user info

独自空忆成欢 提交于 2019-12-05 08:44:25
I'm doing a spree 3.0 installation (ROR) and trying to use facebook oauth for authentication, but the fields sent back after a successful oauth, do NOT contain the email, which is critical to our application. here is the return from the facebook successful authentication. #<OmniAuth::AuthHash credentials=#<OmniAuth::AuthHash expires=true expires_at=1442435073 token="CAAJa3dyBtY4BAJ2ZB3vrenNOFJKSMtvxYO09ZCJtEsmKNBs90q9nmUF4LIBr06xCizEAR3lwht3BwycLkVFdjlvkS1AUGpYODQHu25K0uO8XLDDPkTO0E9oPdIILsbTTOuIT7qcl8nJ6501z0dCXEi9hVNwPYqZBbGqiEhyoLyVgCNnDWdPRLBRF5xSovJdhjjCf6XC8ulJ4NnKBfM8"> extra=#<OmniAuth

Can not run 'rake paperclip:refresh:thumbnails CLASS=Spree::Image' in rails spree app console getting No Such Key

假装没事ソ 提交于 2019-12-04 16:23:45
I am trying to RAILS_ENV=production run rake paperclip:refresh:thumbnails CLASS=Spree::Image on my remote server in my current rails app directory, so I can refresh the spree images that I have uploaded in the past. I am using S3, my bucket is setup correctly as I can see each of my product's images in individual ID folders in my AWS S3 bucket. But each time I run the above command I get a 'No Such Key' Error when the rake is aborted. This command runs locally and works fine. (obviously without the RAILS_ENV=production locally) Ok so I wrote this question to answer it myself. I hope the

issues with Spree

心已入冬 提交于 2019-12-04 14:52:12
问题 I am trying to install and run Spree on my local machine by following the steps mentioned in Getting started with Spree However, when I start the server I get the following error: Could not find table 'pages' Can someone please help me out with this? 回答1: Solved the issue! Generated the following generators: spree_static_content and spree_product_assembly which did the magic! 回答2: Could not find table 'pages' means rails is not being able to find that table in the database. In those

Spree Checkout - Remove Step

走远了吗. 提交于 2019-12-04 13:47:27
I am trying to remove 2 checkout steps. I have tried to follow the documentation in the site http://guides.spreecommerce.com/checkout.html but still nothing happens. I am using Spree 1.1.2 ruby 1.9.2p318 Rails 3.2.6 Ubuntu 12.04 (precise) 32-bit I'll tell you what I have done and you will tell me what to fix. Should I change the name or location of the file? Or should I change other files too? How can I debug it? I have created a new file "app/models/spree/order_decorator.rb" (also tried it under "app/models/order_decorator.rb") module SpreeCustomExtension class Engine < Rails::Engine def self