app/controllers/products_controller.rb
def index
    @groups = Group.order(:name)
    @new_product = Product.new
    @products = filter_products(params[:search])
    @products = sort_results(params, @products)
    @products = @products.paginate(:page => params[:products_page], :per_page =>
          session[:results_per_page])
    respond_to do |format|
      format.html
      format.js  { render :json => Product.rest_show_all, :callback => params[:callback] }
      format.json { render :json => Product.rest_show_all }
      format.xml { render :xml => @products }
    end
  end
# Page for viewing all products at a glance. 
# Contains rest services for viewing products in json
Page for viewing all products at a glance.
Contains rest services for viewing products in json
Page for viewing all products at a glance . Contains rest services for viewing products in json
def index
    @groups = Group.order(:name)
    @new_product = Product.new
    @products = filter_products(params[:search])
    @products = sort_results(params, @products)
    @products = @products.paginate(:page => params[:products_page], :per_page =>
          session[:results_per_page])
    respond_to do |format|
      format.html
      format.js  { render :json => Product.rest_show_all, :callback => params[:callback] }
      format.json { render :json => Product.rest_show_all }
      format.xml { render :xml => @products }
    end
  end
def index @groups = Group . order ( :name ) @new_product = Product . new @products = filter_products ( params [ :search ] ) @products = sort_results ( params , @products ) @products = @products . paginate ( :page => params [ :products_page ] , :per_page => session [ :results_per_page ] ) respond_to do | format | format . html format . js { render :json => Product . rest_show_all , :callback => params [ :callback ] } format . json { render :json => Product . rest_show_all } format . xml { render :xml => @products } end end
Page for viewing all products at a glance.
Page for viewing all products at a glance .