RSS
热门关键字:  java  Ajax  JSP  JSF  Struts
当前位置 : 首页>Ruby>列表

Ruby on Rails技术简介

来源: 作者: 时间:2007-09-19 点击:
people),我们的控制器示意性代码可能如下面这样:

class ProductController < ApplicationController

 

  def add_product    #增加新产品

    if request.get?

      @product = Product.new

    else

      @product = Product.new(params[:product])

      if @product.save

        redirect_to(:action => 'list_products')

      end

    end

  end

 

  def delete_product   #删除产品

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
Google Adsense
相关文章