浏览 1819 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-28
<div id="customer_out"> <%= render :partial => "customer", object => @customer_out%> </div> .erb <%= f.text_field :username, :onchange => remote_function(:update => "customer_out", :with => "'username='+$(this).value + '&come_from='+$('customer_out[come_from]').value", :url =>{:action => 'check_customer'} ) %> .rb def check_customer @customer_out = CustomerOut.find(:first, :conditions => ["username = ? and come_from = ?", params[:username], params[:come_from]]) if @customer_out @customer_out = CustomerOut.new @consignee = @customer_out.customer.consignees.find(:first) end render :partial => 'customer' end 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |