Skip to content

Instantly share code, notes, and snippets.

@Ravenna
Created November 22, 2011 20:50
Show Gist options
  • Save Ravenna/1386908 to your computer and use it in GitHub Desktop.
Save Ravenna/1386908 to your computer and use it in GitHub Desktop.
brand#show
@category = Category.find_by_url_name(params[:category_id])
@brand = Brand.find(params[:id])
@search = Product.order(params[:order] || :descend_by_price).find(:all, :conditions => {:brand_id => @brand.id, :category_id => @category.id})
@products = @search.paginate(:page => params[:page])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment