Sha256: 80437bea85c0685b74819e72a66d95b451cb8fa500645ada649ed1aa3f47ca40

Contents?: true

Size: 591 Bytes

Versions: 1

Compression:

Stored size: 591 Bytes

Contents

class StoreController < RailsCart::BaseController
  before_filter :find_cart

  def index
    list
    render :action => 'list'
  end
  
  # list products in the store
  # TODO: add constraints to the find based on category, etc.
  def list
    @products = Product.find(:all, :page => {:start => 1, :size => 15})
    @product_cols = 3
  end
  
  def show
    @product = Product.find(params[:id])
  end
  
  # AJAX method
  def change_image
    @product = Product.find(params[:id])
    img = Image.find(params[:image_id])
    render :partial => 'image', :locals => {:image => img}
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-0.0.5 starter-app/vendor/plugins/spree/app/controllers/store_controller.rb