Hi,

I tried the method that I stated in the model:

def set_wishlist
 @wishlist = Wishlist.new(params[:wishlist])
end

But once I created the user it returned an error screen stating:

NameError in UsersController#create

undefined local variable or method `params' for #<User:0x4a51a78>
Rails.root: C:/finalproject

Application Trace | Framework Trace | Full Trace

app/models/user.rb:21:in `set_wishlist'
app/controllers/users_controller.rb:35:in `block in create'
app/controllers/users_controller.rb:34:in `create'



My usersController create methods looks like the following:

def create
  @user = User.new(params[:user])
  respond_to do |format|
    if @user.save
      UserMailer.registration_confirmation(@user).deliver
      session[:user_id] = @user.id
      format.html { redirect_to root_url, :notice => "User was 
successfully created." }

    else
      format.html { render :action => "new" }
      format.xml  { render :xml => @user.errors, :status => 
:unprocessable_entity }
    end
  end
end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to