Devise issue

Devise is very powerful, but I am struggling to get it to do what I want

  • I’m very new to rails so please forgive any stupidity in the below.

I followed the instructions on:

http://github.com/plataformatec/devise/wiki/How-to-edit-user-form-without-current-password

– because I don’t want users to have to enter their current password
every time they edit their user info (I store much more than just
email/login details in the user object.

and also:

http://github.com/plataformatec/devise/wiki/How-to-redirect-after-user-edits-his-her-details

I got it working by doing two additional things, first in routes.rb:

devise_for :users, :controllers => { :registrations => “registrations” }

and secondly, after adding the above, I had to copy my
devise/registrations views out to just views/registrations.

But now, on sign_up I get a NoMethod error:

Started GET “/users/sign_up” for 123.3.3.1 at Sat Sep 18 16:20:51 -0700
2010
Processing by RegistrationsController#new as HTML Completed in 49ms

NoMethodError (undefined method new_with_session’ for
#Class:0x2afdd7d8de20):
app/controllers/registrations_controller.rb:67:inbuild_resource’
app/controllers/registrations_controller.rb:8:in `new’

Any ideas? Thank you very much.

“I had to copy my
devise/registrations views out to just views/registrations.”

did you do that in the gem? because you are suppose to use rails g
devise_views to do that

to edit without requiring a password put this in your user model

def password_required?
self.new_record?
end

radhames brito wrote:

“I had to copy my
devise/registrations views out to just views/registrations.”

did you do that in the gem? because you are suppose to use rails g
devise_views to do that

to edit without requiring a password put this in your user model

def password_required?
self.new_record?
end

Thanks for your reply.

That’s the whole problem, just

def password_required?
self.new_record?
end

Does not work. See

http://github.com/plataformatec/devise/wiki/How-to-edit-user-form-without-current-password

You have to make a change to the registration controller, which means
copying it yourself, hence my problems above. Going around in circles on
this, really frustrating. :frowning:

Oh sorry i dont use the registration controller so maybe thats why i
didnt
know that