1
我想創建一個操作,創建一個檢查對象的副本。如何在控制器中創建記錄副本?
我的行動迄今:
def create_multiple
@webhost = Webhost.find(params[:webhost_ids])
@webhost.each do |webhost|
Webhost.new(:webhost)
end
respond_to do |format|
format.html { redirect_to(:admin_webhosts, :notice => 'Konkurrancerne er nu slettet') }
format.xml { head :ok }
end
end
動作渲染,但不創建新的虛擬主機提供商的副本。
現在,它創建一個新的虛擬主機提供商,但沒有數據:webhost_ids是ID檢查的虛擬主機 –
對不起,編輯。這應該夠了吧 – dogenpunk