RailsでDeviseを利用してユーザー登録画面を作成しています。
しかし、以下の挙動の場合に、Routing Errorになります。
①新規登録画面にアクセス(http://0.0.0.0:3000/users/sign_up)
②誤った情報を入力(http://0.0.0.0:3000/users/sign_up)
③エラーが表示される(http://0.0.0.0:3000/users)
④その状態でブラウザの更新ボタンをクリック(http://0.0.0.0:3000/users)
⑤Routing Errorが発生
【原因の推察】
・③のエラーが返ってきたタイミングでURLがhttp://0.0.0.0:3000/usersに変わっている。
・http://0.0.0.0:3000/usersはPOSTでしか受け取れない。
この問題を解決する方法は何かないでしょうか?
以下、登録系のroute情報になります。
user_registration POST /users(.:format) users/registrations#create new_user_registration GET /users/sign_up(.:format) users/registrations#new edit_user_registration GET /users/edit(.:format) users/registrations#edit PATCH /users(.:format) users/registrations#update PUT /users(.:format) users/registrations#update edit_user_registration_detail GET /users/sign_up/detail(.:format) users/registrations#edit_detail PATCH /users/sign_up/detail(.:format) users/registrations#update_detail PUT /users/sign_up/detail(.:format) users/registrations#update_detail user_select GET /users/select(.:format) users/registrations#select
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/21 08:10