0
我已经添加:远程=>真正的_form.html.erb,现在想知道我怎么能得到它,所以当用户保存页面上的东西时,它会保存并随后到来通知。保存使用Ajax和包括通知 - 导轨
在我的documents_controller.rb中,我有;
def create
@document = current_user.documents.build(params[:document])
if @document.save
redirect_to @document.edit, notice: 'Saved'
else
render action: "new"
end
end
def update
@document = current_user.documents.find_by_url_id(params[:id])
if @document.update_attributes(params[:document])
redirect_to @document, notice: 'Saved'
else
render action: "edit"
end
end