Restful_authentication with --stateful option

I’ve been using restful_authentication for several months, and noticed
there have been some security fixes so I figured it was time to
upgrade. I ran into an error, and thought it might have been specific
to the app I’m working on, but I tried creating an app from scratch
and setting up restful_authentication and get the same error. Here’s
what I tired:

rails test_app
cd test_app
script/plugin install restful_authentication
script/plugin install
http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk
script/generate authenticated user sessions --include-activation –
stateful

configure database.yml

rake db:migrate
script/server

Then when I go to http://localhost/users/new and try to sign up a new
user, I get the following:

NameError (undefined local variable or method record' for #<UsersController:0xb7be35ec>): /app/controllers/users_controller.rb:21:in create’

Has anyone else seen this? I’m running rails 2.0.2, and using the
latest versions of the plugins as of today (2/6/2008). If I leave out
the --stateful option, everything works, but of course I’m not using
all of the acts_as_state_machine improvements to
restful_authentication.

Thanks,
Bruz

Hi Bruz,

Yes, I have the same problem and no solution yet.

NameError in UsersController#create
undefined local variable or method `record’ for #<UsersController:
0x2c516e0>

At least your post tells me that leaving out the -stateful option will
work BUT I need this option.

Rgs
euro

Hi,

I was getting this problem too.

In UserController, change:

@user.register! if record.valid?

to

@user.register! if @user.valid?

Working fine for me now.

Hope that helps!

That did the trick! Somehow I figured that the error was just a
symptom of a bigger problem, but in this case I guess it was just that
one line of code. Thanks!