Files
openfoodnetwork/app/controllers/spree/distributors_controller.rb

23 lines
551 B
Ruby

module Spree
class DistributorsController < BaseController
def show
options = {:distributor_id => params[:id]}
options.merge(params.reject { |k,v| k == :id })
@searcher = Config.searcher_class.new(options)
@products = @searcher.retrieve_products
render :template => 'spree/products/index'
end
def select
distributor = Distributor.find params[:id]
order = current_order(true)
order.distributor = distributor
order.save!
redirect_back_or_default(root_path)
end
end
end