Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################customer_controller.rb
- def create
- @customer = Customer.new(params[:customer])
- respond_to do |format|
- if @customer.save
- #flash[:notice] = 'Customer was successfully created.'
- #format.html { redirect_to(@customer, :action => 'new') }
- format.html {redirect_to(:add_to_cart)}
- # format.xml { render :xml => @customer, :status => :created, :location => @customer }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @customer.errors, :status => :unprocessable_entity }
- end
- end
- end
- def add_to_cart
- productdisplay = Product.find(params[:id])
- @productdisplay = Product.find(:first, :conditions => ['id > ? AND product_active = ?', params[:id], "yes"])
- end
- ##########add_to_cart.html.erb
- <%= link_to "next", add_to_cart_url %>
- #########routes.rb
- map.add_to_cart 'add_to_cart', :controller => 'customers', :action => 'add_to_cart'
Add Comment
Please, Sign In to add comment