我建立一個Rails應用程序,並在外面網站的轉化跟蹤的響應。我希望允許用戶在其轉化頁面中粘貼圖片代碼(例如AdWords),並且每當請求該圖片時,我的應用中就會註冊一次轉化。返回一個1x1 .gif注意:在Rails的
respond_to do |format|
if @conversion.save
flash[:notice] = 'Conversion was successfully created.'
format.html { redirect_to(@conversion) }
format.xml { render :xml => @conversion, :status => :created, :location => @conversion }
format.js { render :json => @conversion, :status => :created }
format.gif { head :status => :ok }
else
format.html { render :action => "new" }
format.xml { render :xml => @conversion.errors, :status => :unprocessable_entity }
end
end
這樣,瀏覽器得到一個不存在的.gif圖像。有一個更好的方法嗎?
不存在或破碎? – 2010-05-15 08:52:07