Class: SuppliersController

Inherits:
Spree::BaseController
  • Object
show all
Defined in:
app/controllers/suppliers_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
# File 'app/controllers/suppliers_controller.rb', line 5

def index
  @search = Supplier.search(params[:search])
  @suppliers = @search.all
  respond_with(@suppliers)
end

#showObject



11
12
13
14
# File 'app/controllers/suppliers_controller.rb', line 11

def show
  @supplier = Supplier.find(params[:id])
  @products = Product.find(:all, :conditions => { :supplier_id => @supplier.id , :deleted_at => nil })
end