For example
Imagine I have the following form
<%= form_for(@comment) do |f| %>
<%= f.hidden_field :user_id%>
<%= f.hidden_field :article_id%>
<%= f.label :content %><br />
<%= f.text_area :content %>
<%= f.submit %>
<% end %>
I got the :user_id and :article_id values with:
Comment.new(:user_id => current_user.id, :article_id => @article.id)
When I display the form in the browser it will look like this:
<form action="/comments" method="post">
<input some_rails_tokens_here />
<!-- THIS AREA HERE-->
<input id="comment_user_id" name="comment[user_id]" type="hidden" value="1" />
<input id="comment_article_id" name="comment[article_id]" type="hidden" value="1" />
<!-- THIS AREA HERE-->
<label for="comment_content">Content</label><br />
<textarea id="comment_content" name="comment[content]"></textarea>
<input type="submit" />
</form>
My question is, what if someone changes the post parameters and instead of being the value for :user_id => 1 it is changed to :user_id => 2. The same with the article.
I want to believe that is verified with the rails tokens, but I am not sure.