mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
23 lines
551 B
Ruby
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
|