Rails 3 Devise Registrations Controller Error
I am trying to customize my devise registration fields and tried to add a field. I followed the tutorial at http://ykyuen.wordpress.com/2011/03/03/rails-%E2%80%93-add-custom-fields-to-devise-user-model/ to figure out how to customize the f开发者_如何学Cields. I added the fields and followed the steps. When I run the server I am able to input in the new field but when I click register I get this error.
undefined local variable or method `root_path' for #<Devise::RegistrationsController:0x261a358>
I know in other Devise custom tutorials they say to create a file for the registration controller. Do I need to do that?
The problem is that you're missing the root(_path/_url) defined in your routes.rb as Devise, but nearly all Rails apps, recommends and require.
For example (add to the top):
root to: 'home#index'
Or in Ruby 1.8.7
root :to => 'home#index'
精彩评论