嗨,我有以下表格:
<%= form_for featured_content, :remote => true do |f| %>
<%= f.text_field :url, :value => featured_content.url, :class => "form_text_field ajaxSingle" %>
<%= button_tag "Update", :class=>'greystyle', :type=>"submit" %>
<% end %>
使用以下 JS:
$('.ajaxSingle').live('keyup', function() {
$(this).parents('form:first').submit();
});
这将转到以下控制器操作:
def update
@fc = FeaturedContent.find(params[:id])
@fc.update_attributes(params[:featured_content])
end
这一切都完美无缺。但是,每次更新字段时,我都会在 javascript 控制台中收到以下错误:
ActionView::MissingTemplate (Missing template featured_contents/update, application/update with {:locale=>[:en], :formats=>[:js, "application/ecmascript", "application/x-ecmascript", :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=>[:builder, :erb, :coffee]}. Searched in:
* "/Users/rordev/Code/RubyOnRails/Projects/EverythingEver/Dev/everythingever/app/views"
我只有创建、销毁、更新和索引。我该如何摆脱这个错误?