title: Simple_form: Parameter not passing
body: <p>I am trying to implement a comment feature for a site. So far, I am able to pass the <code>movie_id</code> of the movie I want to comment to, to the page where I create the comment (which is the default scaffold view). After that, I try to pass the <code>movie_id</code> to the <code>create</code> method of the <code>comments_controller</code> but it will not pass. I tried assigning its class (<code>params[:movie_id].class</code>) to the <code>comment</code> attribute and it says <code>NilClass</code>.</p>
  
  <p>My code:</p>
  
  <p><code>comments_controller.rb</code></p>
  
  <pre><code>def create
      @comment = Comment.new
      @comment.comment = params[:comment].values.first
      @comment.user_id = current_user.id
      @comment.movie_id = params[:movie_id]
      #...
  end
  </code></pre>
  
  <p><code>_form.html.erb</code> (The one the <code>new</code> page renders)</p>
  
  <pre><code>&lt;%= simple_form_for(@comment) do |f| %&gt;
      &lt;%= f.error_notification %&gt;
  
      &lt;div class="form-inputs"&gt;
        &lt;%= f.input :comment, label: false, placeholder: 'Your opinion'%&gt;
        &lt;%= f.hidden_field :movie_id, input_html: { value: params[:movie_id] } %&gt;
      &lt;/div&gt;
  
      &lt;div class="form-actions"&gt;
        &lt;%= f.button :submit %&gt;
      &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The <code>params[:movie_id]</code> in the <code>html</code> file, is actually what I want it to be, I tried adding it as a placeholder and it has the correct value.</p>
  
  <p>This will probably be a stupid mistake but, I am really stuck...</p>
  
  <p>Thanks for your time.</p>