0
我有打Rails控制器Ajax請求:Rails的渲染並不使我的新觀點
class MyController < ApplicationController
respond_to :json, :html
def my_method
#logic happens here to produce an instance variable
render template: 'other/template', layout: 'application'
end
end
邏輯重創,鐵軌控制檯顯示:
Rendered other/template.html.haml within layouts/application (34.8ms)
然而,瀏覽器不更新DOM。我錯過了什麼?我怎樣才能使這個工作?
您的AJAX代碼必須處理響應並將其插入到DOM中。 – sevenseacat