0
大家好我是新的rails 3,我有一個應用程序,我想將想法與評論聯繫起來。在rails中使用成員
當我展示一個想法時,在視圖的底部顯示一個表單,爲這個想法提出新的評論,當點擊保存評論時,我必須通過idea_id,我創建我的模型提交
belongs_to :user
belongs_to :idea
attr_accessible :description, :likes, :name, :user_id, :idea_id
在節目的想法的觀點
一個把這個
= render :partial => "comments/index", :collection => @idea.comments
= render :partial => "comments/form", :locals => {:comment=> @comment}
在註釋的_form
包括我的想法獲得idea_id保存
= form_for [@idea, @comment] do |f|
在我的路由器,我把這個
resources :ideas do
member do
resources :comments
end
end
,現在我得到這個錯誤
undefined method `idea_comments_path'
任何想法,任何人都知道一個文件更好地說明如何在軌使用成員!