title: Can I pass params from button submit in Rails 4?
body: <p>I am trying to do something simple: in my Rails view, I have a text input that I want to capture and append to the params. I <a href="https://stackoverflow.com/questions/17916316/is-there-a-way-to-pass-params-when-clicking-submit-button-in-simple-form-view-in">found a similar question</a>, but I want to know if I can do it inline without updating the controller. </p>
  
  <p>First, in the view, I have a form input and a Rails link. These work independently right now for testing, but I can pass the username as a param on button click: </p>
  
  <pre><code>&lt;form&gt;
      &lt;input type="text" name="name"&gt;
   &lt;/form&gt;    
      &lt;%= button_to 'Call Action', points_path(username: @current_user.last.username), method: :post %&gt;
  </code></pre>
  
  <p>I want to remove the <code>@current_user.last.username</code> and instead pass what the user has typed in the input as a param. </p>
  
  <p>Is there a way to do this without a subaction, as outlined above, in the controller (either through a helper or using Javascript with my Rails link)? </p>