title: rails pass variable to model from controller not working
body: <p>Im trying to pass a variable from controller to my form to no avail.</p>
  
  <p>Its working in another controller but cannot make it work for new user registrations.</p>
  
  <pre><code>  def update
      @profile = Profile.find(params[:id])
      @profile.form = "signup"
      ...
    end
  </code></pre>
  
  <p>Inside model I can do <code>@profile.form</code> to get the value</p>
  
  <p>This does not work for new user registrations:
  inside create action:</p>
  
  <pre><code> undefined method `form=' for nil:NilClass
  </code></pre>
  
  <p>how to pass a variable to my model upon new user registration? <code>User = User.new</code> then <code>@user.form == "signup"</code> does not work either, i have :form in my attributes accessible list </p>
  
  <p>Part of model:</p>
  
  <pre><code>  attr_accessible form
    ...
    validates :city_id, :presence =&gt; true, :if =&gt; :signup?
  
  
    def signup?
      #@profile.form == "signup"
      #@user.form == "signup"
      if self.form == "signup"
        return true
      else
        return false
      end
    end
  </code></pre>
  
  <p>EDIT 1:
  Still unable to pass a param to the model :S:S:S tried every possible way and google found solution.</p>
  
  <p>The create method for my registrations#create =</p>
  
  <pre><code>  def create
      profile = Profile.new
      profile.form = "signup"
  
      super
    end
  </code></pre>