目前我正在将我的应用程序升级到 rails 4 并在许多地方使用 RJS。后来我才知道 RJS 已删除,并且它仍然可以通过原型导轨 gem 使用。所以我添加了 gem 并包含在 applicaton.js 中,但我仍然遇到同样的问题。
ActionView::MissingTemplate (Missing template lease/update, application/update with {:locale=>[:en], :formats=>[:js, :html, :xml, :html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :raw, :ruby, :rjs]}
示例代码:我们使用旧的扩展名:例如:
def ajax_refer
render :update do |page|
page.replace_html "lease_container", :partial => "/lease/property_pipeline", :locals => {:note_collection => @note, :portfolio_collection => @portfolio_collection}
end
end
my view is property_pipeline.html.erb
my application.js have
//= require prototype
//= require prototype_ujs
//= require effects
//= require dragdrop
//= require controls
//= require jquery
//= require jquery_ujs
//= require_self
//= require_tree .