<% form_for [commentable, Comment.new], :action => 'create', :remote => false do |f|%>
<%=f.hidden_field :commentable_id, :value=> commentable.id %><br/>
<%=f.hidden_field :parent_id, :value=>1 %><br/>
And a controller:
def create(commentable)
@commentable = commentable.find(params[:comment][:commentable_id])
How I can pass commentable type to a create action in my for_for? Thanks.
@commentable = Commentable.create(params[:comment][:commentable_id])