在我的控制器的create
操作中,我有以下内容:
def create
@article = Article.find(params[:id])
respond_to do |format|
if @comment.save
format.js { render 'success.js' }
else
format.js { render 'failed.js' }
end
end
end
在我的app/views/comments/failed.js.coffee
,我有:
alert 'Write smth!' if $("#comments_error").length == 0
我收到以下错误:
ActionView::MissingTemplate (Missing template comments/failed,
inherited_resources/base/failed, application/failed with
{:locale=>[:en, :en],
:formats=>[:js, :html],
:handlers=>[:haml, :builder, :erb]})
我究竟做错了什么?