Home>
Please write your question in detail here.
We are implementing the guest login function.
I'm setting up routing, but I'm getting a routing error.
How should I resolve this case?
Routing Error
uninitialized constant Users
Rails.root:/Users/xxxx/projects/xxxx
Application Trace | Framework Trace | Full Trace
Routes
Routes match in priority from top to bottom```
### Corresponding source code
users>sessions>new.html.rb
<% = link_to "guest login", users_guest_sign_in_path, method:: post, class: "btn btn-outline-primary w-100 btn-lg"%>
routes.rb
Rails.application.routes.draw do
devise_for: users
devise_scope: user do
post'users/guest_sign_in', to:'users/sessions # new_guest'
end
`` ```
What I triedI checked the prefix path with rails routes, but it existed.
Supplementary information (FW/tool version, etc.)Please provide more detailed information here.
-
Answer # 1
Related articles
- ruby - [rails] about errors when installing bootstrap
- ruby - about rails routing
- ruby - about routing using rails collection
- ruby on rails - about saving comments
- ruby - about accelerating heroku's rails app
- ruby - [rails] about nameerror
- [ruby on rails] about header setting using bootstrap
- ruby on rails - [rails] i want to define routing using the resources method
- ruby on rails - about rails create action
- ruby on rails - about request spec of rspec about test code at login
- ruby on rails - about matters that cannot be migrated
- ruby on rails - about image distribution on heroku and s3
- ruby on rails - about the matter that does not transition to the detail page
- ruby on rails 5 - about lint/syntax error of rubocop
- ruby on rails - rails routing error
- ruby on rails 6 - rails tutorial chapter 14 about follow, unfollow, following? methods
- ruby on rails - about passing the attribute of ror class as an argument
- ruby on rails - about switching screen display on multiple models
- ruby on rails - about primary key/natural key/surrogate key in db design
- ruby on rails 6 - about rails error "wrong number of arguments (given 1, expected 0)"
Related questions
- ruby on rails - [rails] routing error occurs in devise_token_auth and the registration screen cannot be displayed
- ruby - about the problem of duplicate devise error messages (allow_blank: ture doesn't work!)
- ruby on rails - rails devise routing
- ruby - i want to call a partial template with the collection option so that the user detail page shows what the user posted
- ruby - rails5 array contains unintended backslashes
- ruby on rails - after installing devise on rails6, routing error occurs, so i want to eliminate it
- ruby - i want to prevent users other than the poster from transitioning to the page dedicated to the poster (rails)
- ruby - the method defined in the model cannot be used
- ruby - i can't transition to my page for each user after logging out (rails)
rails g devise: controllers users
I used to say rails g devise: controllers user.