Building an index page for a supplier using Spree in rails

I am using spree_drop_ship

as an extension to build my application.

Does spree provide an interface to login to login and see what its products, orders or shipments are?

I checked in Supplier controller

there was no index function specified.

+3


source to share


2 answers


Taking inputs from the answer linked in the comments, your code would be something like this

class SupplierAbility
  include CanCan::Ability

  def initialize(user)
    user ||= User.new
    if user.has_role? "supplier"
      can :read, Product
    end
  end
end

      



And of course by adding this to the spree.rb initializer,

Ability.register_ability(SupplierAbility) 

      

+2


source


You must use it spree_marketplace

together with spree_drop_ship

to get additional functionality for the vendor to add and edit products.



0


source







All Articles