LoginSignup
1
1

More than 5 years have passed since last update.

7章ユーザ登録まで

Last updated at Posted at 2014-08-02

http://railstutorial.jp/chapters/sign-up?version=4.0#sec-signup_failure
ここをやっている

http://localhost:3000/users
にアクセス
The action 'index' could not be found for UsersController
と表示された

controlerにindexがないってこと?
controllers/users_controller.rb
に、
def index
end 

を追加

再度http://localhost:3000/users 
にアクセス

undefined local variable or methodindex' for UsersController:Class

スクリーンショット 2014-08-02 16.21.19.png

そのまま、成功するverをつくってみようとしたけど、やっぱりRouting errorがでた

`$ bundle exec rspec spec/requests/user_pages_spec.rb \

-e "signup with valid information"
No DRb server is running. Running in local process instead ...
Run options: include {:full_description=>/signup\ with\ valid\ information/}
F

Failures:

1) User pages signup with valid information should create a user
Failure/Error: before { visit signup_path }
ActionController::RoutingError:
undefined local variable or method index' for UsersController:Class
# ./app/controllers/users_controller.rb:3:in
class:UsersController'
# ./app/controllers/users_controller.rb:1:in <top (required)>'
# ./spec/requests/user_pages_spec.rb:24:in
block (3 levels) in '

Finished in 0.01528 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/requests/user_pages_spec.rb:42 # User pages signup with valid information should create a user

Randomized with seed 11922

ganshou-no-MacBook-Air:sample_app02 takako$ `

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1