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.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
"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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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? > endThanks for your reply. That''s the whole problem, just> def password_required? > self.new_record? > endDoes 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. :( -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Oh sorry i dont use the registration controller so maybe thats why i didnt know that -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.