title: Using link_to to submit form in Rails
body: <p>I have a form like this:</p>
  
  <pre><code>&lt;%= form_for @isbn, url: { controller: 'ads', action: 'new' }, method: 'get' do |f| %&gt;
     ...
     &lt;%= f.text_field(:value, placeholder: 'Type ISBN') %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>How would I go about creating a link_to with a pre-defined ISBN-num value, so that is submitted directly to my new action.</p>
  
  <p>I have tried</p>
  
  <pre><code>&lt;%= link_to 'Sell this book', sell_book_path(current_user.id, value: book.isbn) %&gt;
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>sell_book GET    /users/:id/sell_book(.:format)        ads#new
  </code></pre>
  
  <p>... but the value doesn't seem to get passed to the controller action.</p>
  
  <p>Thanks for any help! :)</p>
  
  <p>URL when submitting the form (book showing up correctly and ad is ready to be created):</p>
  
  <pre><code>.../users/7/sell_book?utf8=%E2%9C%93&amp;isbn%5Bvalue%5D=9781449382674
  </code></pre>
  
  <p>URL when using the link_to (failing):</p>
  
  <pre><code>.../users/7/sell_book?value=9780321573513
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Got it working :) did:</p>
  
  <pre><code>&lt;%= link_to 'Sell this book', sell_book_path(current_user.id, :isbn =&gt; { :value =&gt; book.isbn }) %&gt;
  </code></pre>
  
  <p>Thanks to all who responded :)</p>