2013-05-10 25 views
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

回答

1

你能也許告訴我們討論您的show contorller行動?

我想這樣的事情可能會解決你的問題:

= best_in_place @discussion, :name, :type => :textarea, :path => school_class_discussion_path(params[:class_id], @discussion) 
= best_in_place c, :body, :type => :textarea , :path =>school_class_discussion_comment_path(params[:class_id], @discussion, c) 
+0

謝謝!這樣可行 :) – Oatmeal 2013-05-10 08:46:39

相關問題