In order to present a filtered product list, custom SQL requests in the controller are used to send back a specified list.
if params[:categories]
@products = @products.joins(:categories, :types).where(types: {name: params[:categories]}).uniq
endSee the Products Controller for details See it in action here
Page requests are sent through custom fetches.
this.collection.fetch({
data: {
page: this.collection.pageNum + 1,
type: "fetch_by_page",
categories: this.collection.categories
},
success: function() {
this.collection.pageNum = this.collection.pageNum + 1;
window.scrollTo(0, 0);
this.render();
}.bind(this)
});See the Products Index for details. See it in action here
- A single-page Backbone.js app built on a RESTful Ruby on Rails architecture
- OmniAuth and User Auth stored through BCrypt
- Rate and Review products using RatyRate Gem
- Add products to cart and checkout using custom AJAX methods
- Filter search using custom AJAX requests
- Prefix search using PgSearch
- Image uploads using AWS via Paperclip
- Deep product layout using multiple associations
- Amazon Prime
- Pagination/infinite scroll
- Multiple sessions/session management
- User avatars
- Algorithm for "Recommended Products"
- Thumbnails for product images