restful_authentication with --stateful option

2 views
Skip to first unread message

Bruz

unread,
Feb 6, 2008, 4:15:31 PM2/6/08
to Ruby on Rails: Talk
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

euro

unread,
Feb 7, 2008, 7:42:20 AM2/7/08
to Ruby on Rails: Talk
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

On Feb 6, 9:15 pm, Bruz <bruz.marz...@gmail.com> wrote:
> 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 installhttp://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 tohttp://localhost/users/newand try to sign up a new
> user, I get the following:
>
> NameError(undefinedlocalvariableormethod`record' for

LogicLab

unread,
Feb 7, 2008, 11:23:06 AM2/7/08
to Ruby on Rails: Talk
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!
> > Then when I go tohttp://localhost/users/newandtry to sign up a new

Bruz

unread,
Feb 7, 2008, 8:01:09 PM2/7/08
to Ruby on Rails: Talk
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!
Reply all
Reply to author
Forward
0 new messages