spree

Bundler could not find compatible versions for gem “rails” | In Gemfile: rails (~> 6.1.0) x64-mingw3

橙三吉。 提交于 2021-02-10 17:37:19
问题 I'm developing a new Ruby on Rails project with Spree Commerce and while running bundle install I'm getting the following error: Bundler could not find compatible versions for gem "rails": rails (~> 6.1.0) x64-mingw32 spree (~> 4.1) x64-mingw32 was resolved to 4.2.0.beta, which depends on spree_core (= 4.2.0.beta) was resolved to 4.2.0.beta, which depends on rails (~> 6.0.0) I'm following Spree Commerce Docs for its installation. I'm on Windows 10 , using Ruby 2.7.2 , Bundler 2.2.3 and Rails

rake assets:precompile RAILS_ENV=production Error

时光毁灭记忆、已成空白 提交于 2020-08-11 05:33:54
问题 I want to deploy a spree app to heroku and in order to do that I need to precompile my assets locally I did heroku addons:create heroku-postgresql then I added config/application.rb config.assets.initialize_on_precompile = false my database.yaml file is default: &default adapter: postgresql encoding: unicode pool: 5 development: <<: *default host: localhost database: anzels_development username: anzels password: 1234 test: <<: *default host: localhost database: anzels_test username: anzels

How do you authorize access to a page dealed by a controller without corresponding model with Cancancan?

浪尽此生 提交于 2020-06-01 05:39:29
问题 The issue A Spree admin controller without corresponding model, whose access trial redirect to an other page. The corresponding attempt code: module Spree module Admin class TutorialsController < Spree::Admin::BaseController authorize_resource :class => false def index end end end end And in app/models/spree/ability_decorator.rb the following was added: can :manage, :'tutorial' can :manage, :'admin/tutorial' can :manage, :'admin_tutorial' can :manage, :'spree/admin/tutorial' can :manage, :

Javascript/Jquery not working in Spree

给你一囗甜甜゛ 提交于 2020-01-17 10:33:53
问题 Hey guys I have an application using spree and I need to implement some new javascript to create a new promotion rule. Unfortunately I'm unable to access any js files regardless of where I put them. I've even tried overriding sprees files such as promotions.js to implement new functions but it's just not going through. I've tried placing the js file in the following : app/assets/javascript/spree/backend vendor/assets/javascript/spree/backend In my partial _product_value.html.erb : <button

Javascript/Jquery not working in Spree

烈酒焚心 提交于 2020-01-17 10:32:48
问题 Hey guys I have an application using spree and I need to implement some new javascript to create a new promotion rule. Unfortunately I'm unable to access any js files regardless of where I put them. I've even tried overriding sprees files such as promotions.js to implement new functions but it's just not going through. I've tried placing the js file in the following : app/assets/javascript/spree/backend vendor/assets/javascript/spree/backend In my partial _product_value.html.erb : <button

Can't find root of 'stack level too deep' error when rendering partial

佐手、 提交于 2020-01-15 04:24:21
问题 I've been stuck on this problem for a week. I will mail you a bottle of scotch if you can figure it out. Seriously, its come to bribery. On taxons#show I'm rendering a products partial, _products.html.erb , which lists out all the products on a table to the show view of the taxons controller. When you click a product, by default the app will redirect the user to products#show , where the _cart_local.html.erb partial is rendered to display 'add to cart' options. But on taxons#show , when a

In Spree 2.0.3 , How would I remove shipping address in Spree checkout routine?

雨燕双飞 提交于 2020-01-07 05:48:28
问题 I tried to create app/models/spree/order_decorator.rb as : Spree::Order.class_eval do checkout_flow do go_to_state :address go_to_state :payment, :if => lambda { |order| order.payment_required? } go_to_state :confirm, :if => lambda { |order| order.confirmation_required? } go_to_state :complete remove_transition :from => :delivery, :to => :confirm end end but this code only removes delivery process , I think I have to make some changes in order model but that was too complicated for me ,

Spree - how to add multiple products to cart

让人想犯罪 __ 提交于 2020-01-07 03:03:11
问题 I have created a semi-custom Addon function for products. I created a new relationship table in the backend which connects one product to another product (through a checkbox and an ajax request in the backend). What I am having trouble with is how to manipulate the populate_orders_path so that I can pass various variant/product id's to the cart at the same time. Currently in my cart form partial I have this: <div id="product-addons" class="col-md-6"> <h3 class="product-section-title">Add Ons<

What does this Rails Engine code mean: config.to_prepare &method(:activate).to_proc

▼魔方 西西 提交于 2019-12-31 08:39:11
问题 I'm working with Spree, which uses Rails engines extensively. A common pattern I find is this. However I have trouble understanding this code. class Engine < Rails::Engine def self.activate ... end config.to_prepare &method(:activate).to_proc end What does .to_prepare do What does the &method operator do? What is the overall effect of the code? Many Thanks! 回答1: &method(:activate).to_proc This is best consumed one item at a time. (It should be noted that this portion of the code is 100% non