Reputation: 2951
I just created rails 3.1 app and updated devise 1.4.7.But When i browse http://localhost:3000/users/sign_up(as indicated in rake routes) ,I get " NoMethodError in Devise/registrations#new " extracted source is line
3: <%= form_for(resource_name, resource, :url => registration_path(resource_name)) do |f| %>.
What is the solution to this?Thank you in advance.
routes.rb
Deals::Application.routes.draw do
devise_for :users
match "/users/sign_up" => "devise/registrations#new"
root :to => "home#index"
end
Upvotes: 0
Views: 1983
Reputation: 16
You can try devise_for :users
followed directly by resources :users
Upvotes: 0
Reputation: 3137
Use these lines in your routes.rb file.
root :to => "home#index"
devise_for :users
devise_scope :user do
get "sign_in", :to => "devise/sessions#new"
get "sign_out", :to => "devise/sessions#destroy"
get "sign_up", :to => "devise/registrations#new"
end
Upvotes: 2
Reputation: 5034
Take out this part in config/routes.rb
:
match "/users/sign_up" => "devise/registrations#new"
That's redundant, devise_for :users
will add that route.
Upvotes: 0