title: Why do I get nil when passing values through params in a form?
body: <pre><code>&lt;% if current_user.blank? %&gt;
  &lt;%tripowner=User.find_by_id(@trip.userid).id%&gt;
  &lt;%=tripowner%&gt;
    &lt;h3 class="text-center"&gt;Please sign up to provide recommendations.&lt;/h3&gt;
      &lt;%= form_tag usersback_url, class: "form-signin", method: 'post' do %&gt;
      &lt;h2 class="form-signin-heading"&gt;SIGN UP&lt;/h2&gt;
      &lt;div&gt;
        &lt;%= text_field_tag :first_name, nil, class: "input-block-level", placeholder: "First" %&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;%= text_field_tag :last_name, nil, class: "input-block-level", placeholder: "Last"  %&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;%= email_field_tag :email, nil, class: "input-block-level", placeholder: "Email address"  %&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;%= password_field_tag :password, nil, class: "input-block-level", placeholder: "Password"  %&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;%= password_field_tag :password_confirmation, nil, class: "input-block-level", placeholder: "Confirm Password"  %&gt;
      &lt;/div&gt;
        &lt;%= hidden_field_tag :tripowner, value: tripowner %&gt;
      &lt;div&gt;
        &lt;%= submit_tag "SIGN UP", :class =&gt; 'btn btn-large btn-success' %&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
  &lt;%end%&gt;
  </code></pre>
  
  <p><code>:tripowner</code> is not passing through the params correctly, but is returning nil.  I am trying to do this with it in the action.  I have confirmed that <code>tripowner</code> yields 1.  Therefore, I want <code>@friendship.f2</code> to be 1.  Is there a reason why it's returning nil below?</p>
  
  <pre><code>def createback
  
  @user = User.new
  @user.first_name = params[:first_name]
  @user.last_name = params[:last_name]
  @user.email = params[:email]
  @user.password = params[:password]
  @user.password_confirmation = params[:password_confirmation]
  
  @friendship = Friend.new
  @friendship.f2 = params[:tripowner]
  if @user.save
  
  @friendship.f1 = @user.id
  @friendship.confirmed = true
  @friendship.save
  
  reset_session
  session[:user_id] = @user.id
  
  redirect_to :back, notice: "Signed up successfully."
  
  else
    render 'new'
  end
  </code></pre>
  
  <p>end</p>
  
  <p>friend model</p>
  
  <pre><code>class Friend &lt; ActiveRecord::Base
  belongs_to :user
  end
  </code></pre>
  
  <p>params: Parameters: {"utf8"=>"✓", "authenticity_token"=>"BkVY0/z0KeCQRg83wvumUKEmT67R4liMZr33u98mTBE=", "first_name"=>"rki", "last_name"=>"rki", "email"=>"test@k", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "tripowner"=>"{:value=>1}", "commit"=>"SIGN UP"}</p>
  
  <p>As you can see, the 1 is being passed properly in tripowner.</p>