【发布时间】:2013-05-10 08:30:40
【问题描述】:
我使用 gem Best In place 来编辑讨论主题和 cmets... 它适用于 Discussion 但对于 Comments 它给出记录未找到错误:
我的路线:
命名空间:学校做
资源 :account, :except => [:new, :create, :destroy], :controller => 'account'
资源 :classes, :path => "" 做
资源:讨论做
资源:cmets
结尾
结尾
结束
show.html.haml(讨论)
= best_in_place @discussion, :name, :type => :textarea, :path => school_class_discussion_path
= best_in_place c, :body, :type => :textarea , :path =>school_class_discussion_comment_path(params[:class_id], @discussion)
discussion_controler.rb
def update
@discussion.update_attributes(params[:discussion])
respond_with @discussion
end
cmets_controller.rb
def update
@comment = Comment.find(params[:id])
@comment.update_attributes(params[:comment])
respond_with @comment , :location => school_class_discussion_comment_path(params[:class_id], @discussion))
end
我可以点击 cmets 并编辑但不更新:( 日志错误:
[Raven] 用户排除错误:ActiveRecord::RecordNotFound 评论 id = 实际上给出了讨论 id
【问题讨论】:
标签: ruby-on-rails ajax jquery jquery-plugins