title: Rails - Passing parameters to create filled in form
body: <p>I want to pass some parameters with link_to method to create method, so that the form will shown prefilled to a user.</p>
  
  <p>I wrote this code to pass the parameters,</p>
  
  <pre><code>&lt;%= link_to "Buy", new_transaction_url(:friend_id =&gt; @friend.id, :t_type =&gt; 2) %&gt;
  </code></pre>
  
  <p>And in transactions_controller's new method, I have:</p>
  
  <pre><code>@transaction = Transaction.new
  @transaction.t_type = params[:t_type]
  </code></pre>
  
  <p>It didn't work as well.</p>
  
  <p>That would be great if you can help me.</p>
  
  <p>Thanks.</p>