Sha256: 43cf897f6cb7dc112c06a2683c2993243e189e4589a124ff191c35823e9547fa

Contents?: true

Size: 823 Bytes

Versions: 5

Compression:

Stored size: 823 Bytes

Contents

class ProductsController < ApplicationController
  before_filter :get_cart_order

  # GET /products
  # GET /products.xml
  def index
    @products = Product.published.find(:all, :order => "featured DESC, title")
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @products }
    end
  end
  
  # GET /products/1
  # GET /products/1.xml
  def show
    @product = Product.find(params[:id])
    @page_title = @product.seo_title.blank? ? @product.title : @product.seo_title
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @product }
    end
  end

  def preview
    flash.now[:notice] = "Please note that product images do not appear in previews."
    @product = Product.new(params[:product])
    render :action => :show
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/controllers/products_controller.rb
forge-cli-0.1.9 lib/forge/app/controllers/products_controller.rb
forge-cli-0.1.8 lib/forge/app/controllers/products_controller.rb
forge-cli-0.1.7 lib/forge/app/controllers/products_controller.rb
forge-cli-0.1.6 lib/forge/app/controllers/products_controller.rb