title: passing parameters through link_to method in ruby on rails 4
body: <p>i have an index view that shows all available classes i want a link to "sign up for class" that redirects me to the "sign up" form and fill up some other values and when the sign up is created it saves the values that i filled up plus the foreign key of the class i just passed via the link to method </p>
  
  <p>classes index:</p>
  
  <pre><code>&lt;h1&gt;Listof classes&lt;/h1&gt;
  
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;id&lt;/th&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Description&lt;/th&gt;
        &lt;th&gt;Actions&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;% @classes.each do |class| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= class.id %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= class.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= class.description %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= link_to 'sign up!', new_sign_up_path(:class_id =&gt; class.id), method: :post %&gt;&lt;/td&gt; 
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
     
  
  <p>sign_up controller:</p>
  
  <pre><code>class SignUpsCOntroller &lt; ApplicationController
    before_action :set_sign_ups, only: [:show, :edit, :update, :destroy]
  
    # GET /sign_ups/new
    def new
      @sign_up = SignUp.new
    end
  
      def set_sign_ups
        @sign_up = SignUp.find(params[:id])
      end
  
      def sign_up_params
        params.require(:sign_up).permit(:date, :status, :type, :class_id)
      end
  end
  </code></pre>
  
  <p>and my sign ups form:</p>
  
  <pre><code>&lt;%= form_for(@sign_up) do |f| %&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :date %&gt;&lt;br&gt;
      &lt;%= f.date_select :date %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :status %&gt;&lt;br&gt;
      &lt;%= f.check_box :status %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :type %&gt;&lt;br&gt;
      &lt;%= f.number_field :type %&gt;
    &lt;/div&gt;
      &lt;div class="field"&gt;
      &lt;%= f.hidden_field :class_id %&gt;
    &lt;/div&gt;
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>when i save it it doesn't save the the class_id... i've tried parsing it to integer i've tried it without the hidden field but it allways passes it as blank en saving... any ideas?</p>