Notes posted by cantbecoolRSS feed
Here’s a pseudo code example of a hidden field within an ERB template. A post has many comments and this comment form is in a post’s show view. This would set a comment’s post_id attribute.
<%= form_for(@comment) do |f| %>
<%= f.hidden_field :post_id, :value => @post.id %>
<% end %>