Sha256: a2c26eaf4e27e6ee3572c5a6f1a1196ee9293e54c725cf5b9574a266223c6541
Contents?: true
Size: 1.21 KB
Versions: 24
Compression:
Stored size: 1.21 KB
Contents
require 'rho/rhocontroller' class ProductController < Rho::RhoController #GET /Product def index @products = Product.find(:all) add_objectnotify(@products) render end # GET /Product/{1} def show @product = Product.find(@params['id']) render :action => :show end # GET /Product/new def new @product = Product.new render :action => :new end # GET /Product/{1}/edit def edit @product = Product.find(@params['id']) render :action => :edit end # POST /Product/create def create @product = Product.new(@params['product']) @product.save # immediately send to the server SyncEngine.dosync_source(@product.source_id) redirect :action => :index end # POST /Product/{1}/update def update @product = Product.find(@params['id']) @product.update_attributes(@params['product']) # immediately send to the server SyncEngine.dosync_source(@product.source_id) redirect :action => :index end # POST /Product/{1}/delete def delete @product = Product.find(@params['id']) @product.destroy # immediately send to the server SyncEngine.dosync_source(@product.source_id) redirect :action => :index end end
Version data entries
24 entries across 24 versions & 1 rubygems