I want to display the user sign-in screen at http: // localhost: 3000/users/sign_in.
The top screen is displayed as desired
When I try to transition to the sign-in screen, the top screen is displayed and no error message appears in the browser.
We are currently in the process of creating a simple application like SNS.
Arrange the outline layout with bootstrap and install devise. When I tried to enter the sign-in screen http: // localhost: 3000/users/sign_in after writing the routing, model, controller, and view, the top page remained.
Even if I try to enter http: // localhost: 3000/users/sign_in directly, it will enter the top page.
At the console
ActionController :: RoutingError (No route matches [GET] "/ users/sign_in% E3% 80% 80% E3% 81% A7% E3% 83% 88% E3% 83% 83% E3% 83% 97% E7% 94 % BB% E9% 9D% A2% E3% 81% AB% E8% A1% 8C% E3% 81% A3% E3% 81% A6% E3% 81% 97% E3% 81% BE% E3% 81% 86 "):
Corresponding source code
Message was out.
views/devise/sessions/new.html.erb Log in<% = form_for (resource, as: resource_name, url: session_path (resource_name)) do | f |%><% = f.label: email%><br /><% = f.email_field: email, autofocus: true, autocomplete: "email"%> <% = f.label: password%><br /><% = f.password_field: password, autocomplete: "current-password"%><% if devise_mapping.rememberable?%> <% = f.check_box: remember_me%> <% = f.label: remember_me%> <% end%> <% = f.submit "Log in"%><% end%><% = render "devise/shared/links"%>
What I tried
routes.rb Rails.application.routes.draw do devise_for: users root to: "posts # index" end
I reinstalled the device. The model and migration file have been recreated, and the login screen originally created with bootstrap has been changed to a simple teaching material.Supplementary information
I think that there is a lack of information or points that are not reached in the first post, beginners.
I would like to ask the professor how to ask questions and how to think.
Answer # 1
Answer with "guess".
Go to the top screen withIs included in the URL of the error message,
"/ users/sign_in% E3% 80% 80% E3% 81% A7% E3% 83% 88% E3% 83% 83% E3% 83% 97% E7% 94% BB% E9% 9D% A2% E3% 81% AB% E8 % A1% 8C% E3% 81% A3% E3% 81% A6% E3% 81% 97% E3% 81% BE% E3% 81% 86"
What kind of URL was actually accessed?
I'd like you to show me the controller, but in the first place, routes
users/sign_inThere is nothing about it, and first of all there. (If you can link with devise: users, unnecessary words are included in the URL, so actually
I go to the top screen with/users/sign_inI am accessing with. )
So, because I am using device, I think that it is judged that "non-existent URL = not authenticated" and redirected to the top page.
How to deal with it depends on the design.
- laravel screen is not displayed on localhost even after "php artisan serve"
- ruby - the view of the search screen is not displayed
- the unity webgl game screen is not displayed at the link destination of the server launched with #web server for chrome
- ruby on rails - when i make a message, i want the date to be displayed, but i get "undefined method` strftime' for nil: nil
- c ++ - i want to know what to doubt if nothing is displayed on the screen as a result of zooming, rotating, translating, and loc
- ruby - [rails] actioncontroller :: parametermissing is displayed when using fields_for and data is not saved
- ruby - aws access denied for user'hoge' @'localhost' (using password: no)
- php - the posting screen can be displayed without going through the login screen
- the screen is not displayed due to the bundled settings of spring and nuxtjs
- ruby on rails - unable to access localhost with rails6 and docker
- ruby - i want to save the id from the post screen for reviews for products
- ruby - i get a 500 internal server error on localhost (rails)
- c # - toolbox is not displayed even on the screen of visual studio design
- reactjs - i want to redraw the displayed post list screen when i edit or delete a post
- ruby - payjp payment information screen is not displayed properly [rails]
- ruby on rails 5 form_for not displayed
- ruby - images in assets files are not displayed correctly in the rails app
- tcl/tk screen is not displayed, etc
- ruby - sass :: syntaxerror on rails s
- ruby - i want to use two rails renders
- ruby - [rails] the class attribute specified by the div tag enclosed in simple_format is not applied
- ruby on rails removal function
- ruby on rails sorting
- html - i can't set the regular expression well
- ruby - rails i want to make the created_at time the same when creating multiple data at once
- ruby - dynamic form implementation in nested_form