たとえば
、次のフォームがあると想像してください
<%= 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 %>
:user_id と :article_id の値を取得しました:
Comment.new(:user_id => current_user.id, :article_id => @article.id)
ブラウザでフォームを表示すると、次のようになります。
<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>
私の質問は、誰かが投稿パラメーターを変更し、 :user_id => 1 の値ではなく :user_id => 2 に変更された場合はどうなるかということです。記事と同じです。
Railsトークンで検証されていると信じたいのですが、よくわかりません。