0
我用寶石最好的地方進行編輯討論主題和評論...它適用於討論,但註釋它給記錄未找到錯誤: 我的路線:
namespace:school do resource:account,:except => [:new,:create,:destroy],:controller =>'account' resources:classes,:path = > 「」 做 資源:討論做 資源:評論 結束 結束 結束使用best_in_place寶石:烏鴉]用戶排除錯誤:#<的ActiveRecord :: RecordNotFound
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
comments_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
我可以點擊評論和編輯,但不更新:(日誌錯誤:
[烏鴉]用戶排除錯誤:具有ID的ActiveRecord :: RecordNotFound評論= 實際上給討論ID
謝謝!這樣可行 :) – Oatmeal 2013-05-10 08:46:39