views:

60

answers:

2

I have a Rails app handling authentication with the restful_authentication plugin.

I'm experiencing problems with the email activation feature and before I deal with that I would like to just allow my users to register without having to go through the email activation process.

How do I disable the email activation feature.

Rails 2.2.3 Restful_authentication

+1  A: 

The best solution I think is regenerating the authentication:

Save your old code from User and Sessions (from model and controller, if you coded something in that files), destroy the authentication and regenerate it

script/destroy authenticated user sessions
script/generate authenticated user sessions

The destroy script will delete the following files, be sure of backup it if you made any change.

rm  db/migrate/20100520071407_create_users.rb
rm  app/views/users/_user_bar.html.erb
rm  app/views/users/new.html.erb
rm  app/views/sessions/new.html.erb
rm  app/helpers/users_helper.rb
rm  app/helpers/sessions_helper.rb
rm  test/fixtures/users.yml
rm  test/unit/user_test.rb
rm  test/functional/users_controller_test.rb
rm  test/functional/sessions_controller_test.rb
rm  config/initializers/site_keys.rb
rm  lib/authenticated_test_helper.rb
rm  lib/authenticated_system.rb
rm  app/controllers/users_controller.rb
rm  app/controllers/sessions_controller.rb
rm  app/models/user.rb
pablorc
Thanks pablorc. Ideally I would have liked to not go that way. I'll see if anybody else knows another way.
allesklar
You can remove the code yourself, but I find it slower and more difficult than regenerate it. Also, this way you aren't going to have useless code on your application.I think it's the best option, but maybe I'm wrong. Let's wait
pablorc
+1  A: 

In app/models/user_observer.rb, I replaced

UserMailer.deliver_signup_notification(user)

with

user.activate!

and it's working for me so far...

Haon99
Yes, that's the best solution. Thanks
allesklar