我有一个表单,它是“comments”对象的一部分,它是“post”对象的子对象,而“post”对象又是“Category”对象的子对象,我收到带有以下代码的上述错误消息(使用 simple_forms ) 有什么建议吗?
= simple_form_for([@post, @post.comments.build], html: {class: 'form-horizontal'}) do |f|
= f.input :comment, label: "Your Reply", input_html: {class: "form-control"}
= f.submit
路线.rb:
Rails.application.routes.draw do
devise_for :users
resources :categories do
resources :posts do
resources :comments
end
end
root 'categories#index'
end