我正在使用acts_as_commentable。这就是模型添加评论的方式:
commentable = Post.create
commentable.comments.create(:title => "First comment.", :comment => "This is the first comment.")
宝石细节可以在这里找到:
https://github.com/jackdempsey/acts_as_commentable
在formtastic中,我通常会传递模型,然后是输入字段......这仍然有效吗?
<%= semantic_form_form 'review' do |form| %>
<%= form.input :title %>
<%= form.input :comment %>
<% end %>
在控制器中......?
commentable.comments.create(params(:review))
我不确定这是否会传递可用的哈希值....谢谢!