<div id="tabs"> <ul> <li><a href="#tabs-1">公司</a></li> <li><a href="#tabs-2">员工</a></li> <li><a href="#tabs-3">集装箱</a></li> </ul> <div id="tabs-1">Company</div> <div id="tabs-2">Employee</div> <div id="tabs-3">Container</div></div>
# POST /containers # POST /containers.xml def create @container = Container.new(params[:container]) respond_to do |format| if @container.save flash[:notice] = 'Container was successfully created.' format.html { redirect_to @container) } format.xml { render :xml => @container, :status => :created, :location => @container } else format.html { render :action => "new" } format.xml { render :xml => @container.errors, :status => :unprocessable_entity } end end end
# POST /containers # POST /containers.xml def create @container = Container.new(params[:container]) respond_to do |format| if @container.save flash[:notice] = 'Container was successfully created.' format.html { redirect_to container_path(@container, :anchor => "tabs-3") } format.xml { render :xml => @container, :status => :created, :location => @container } else format.html { render :action => "new" } format.xml { render :xml => @container.errors, :status => :unprocessable_entity } end end end
【实 × 新 × 奇】http://www.lycom.de/ 最新报道Ruby语言、Rails框架、Ubuntu、MacOSX和软件技术信息
订阅 full-text RSS 或者 comments RSS.
Interesting links can be found at del.icio.us or by subscribing to my del.icio.us feed
Powered by SimpleLog