rake routes fails because of "missing action"
I started a clean rails app, installed and migrated the devise gem as well as a couple straightforward models of my own. The devise user controller methods are not working (I get an error page when I go to localhost:3000/users/new but not when I got to /users/sign_up). When I run rake --trace routes, I get the following output:
(in /Users/tim/Coding/rails_projects/libertyhive)
** Invoke routes (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! missing :action /Users/tim/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/actionpack-3.0.4/lib/action_dispatch/routing/mapper.rb:167:in `default_controller_and_action'/Users/tim/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/actionpack-3.0.4/lib/action_dispatch/routing/mapper.rb:68:in `normalize_options!'
and it continues with many more lines o开发者_高级运维f /Users/tim/.rvm/gem/ruby-1.9.2-p136@rails3tutorial/gems/...
I have no idea how to debug this. I'm pretty new to rails. Did the Rails 3 Tutorial by Michael Hartl, which helped me through most of the general setup and configuration of rails.
Any idea what the problem is?
Rails uses a RESTful interface by default for routing URLs. That means there is no action called :sign_up.
The user signup URLs would be:
- the form to add a new user: http://localhost:3000/users/new (a GET request)
- when you submit the form for a new user: http://localhost:3000/users ( a POST request)
精彩评论