[Newbie] undefined method `useremail' error


#1

Hi all,

I’m just starting out… the solution to this must be really trivial but
can’t figure out what’s wrong. I’m using Webrick + Rails 1.0

The error is:

undefined method `useremail’ error

What am I missing?

Thanks,
Lorenzo

class User < ActiveRecord::Base
set_table_name ““tblUser””
set_primary_key “UserID”

validates_presence_of :useremail, :userpassword
validates_confirmation_of :userpassword
end

class UserController < ApplicationController
def register
if request.get?
@user = User.new
elsif request.post? and @user.save
User.new(@params[:user])
flash[:notice] = “User created”
redirect_to :action => “register”
else
flash[:notice] = “Error occurred”
redirect_to :action => “register”
end
end
end

Register Register Email: <%= text_field("user", "useremail") %> Password: <%= text_field("user", "userpassword") %> Repeat password: <%= text_field_tag(:userpassword_confirmation, @params[:userpassword_confirmation]) %>

PostgreSQL DDL

CREATE TABLE “public”.“tblUser” (
“UserID” BIGSERIAL,
“PersonTitleID” BIGINT,
“SecretQuestionID” BIGINT,
“UserFirstName” VARCHAR,
“UserLastName” VARCHAR,
“UserEmail” VARCHAR NOT NULL,
“UserPassword” VARCHAR NOT NULL,
“UserEmailVerified” BOOLEAN DEFAULT false NOT NULL,
“UserRegistrationDate” DATE,
“UserPhone” VARCHAR,
“UserAltPhone” VARCHAR,
“UserSecretQuestionAnswer” VARCHAR,
“UserSex” BOOLEAN,
“UserDateOfBirth” DATE,
“UserTags” VARCHAR,
“UserIsBanned” BOOLEAN,
“UserIsAgent” BOOLEAN,
“UserCreditLeft” MONEY,
“UserRating” SMALLINT,
CONSTRAINT “tblUser_UserID_key” UNIQUE(“UserID”),
CONSTRAINT “FK_PersonTitleID” FOREIGN KEY (“PersonTitleID”)
REFERENCES “public”.“tblPersonTitle”(“PersonTitleID”)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE,
CONSTRAINT “FK_SecretQuestionID” FOREIGN KEY (“SecretQuestionID”)
REFERENCES “public”.“tblSecretQuestion”(“SecretQuestionID”)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE
) WITH OIDS;


#2

Lorenzo B. wrote:

Hi all,

I’m just starting out… the solution to this must be really trivial but
can’t figure out what’s wrong. I’m using Webrick + Rails 1.0

The error is:

undefined method `useremail’ error

Got it. It’s a problem of case. Fixed now.

Tnx,
Lorenzo