spree-auth-devise

Spree generic implementation for api token

馋奶兔 提交于 2019-12-24 11:26:49
问题 I an deleting items from spree cart using the following spree api url /api/orders/#{current_order.number}/line_items/#{line_iem.id}?line_item[variant_id]=#{line_item.variant.id}&line_item[quantity]=0&token=MyToken the token used here is of a single user. I want to implement this in generic way so that it can be used for both guest and registered user.. is it possible? any help would be highly appreciated Regards 回答1: Whenever you create an order using the Spree API, you get an order_token in

Adding name to Spree Devise registration

拜拜、爱过 提交于 2019-12-11 03:32:15
问题 I am trying to add name, surname and birthdate to devise registration with Spree. I have installed the gem gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable' Created the migration: class AddFieldsToSpreeUsers < ActiveRecord::Migration def change add_column :spree_users, :name, :string add_column :spree_users, :surname, :string add_column :spree_users, :birthdate, :time end end Created a new form to add the fields app/views/spree/shared/_user_form.html.erb Defined

Override a private method in the lib folder of a gem

↘锁芯ラ 提交于 2019-12-10 15:48:35
问题 There is a private method in the spree-auth-devise gem. The method is inside the controller UserSessionsController https://github.com/spree/spree_auth_devise/blob/master/lib/controllers/frontend/spree/user_sessions_controller.rb I wish to override the function "redirect_back_or_default". Is this possible? Update After mixing and matching between your answers and doing some googling, I arrived at this solution: Spree::UserSessionsController.class_eval do private def redirect_back_or_default