mikker / passwordless

🗝 Authentication for your Rails app without the icky-ness of passwords
MIT License
1.28k stars 89 forks source link

Routing error with new_user_path #72

Closed no1-knows closed 4 years ago

no1-knows commented 4 years ago

Hello, my <%=link_to “NEW” new_user_path %> does not work. If I use new_user_path, the link is /users/users/new not /users/new. Please let me give some routing advise.

Here is my setting so far. I can open the page and save email with direct url like “http://localhost:3000/users/new

routes.rb

Rails.application.routes.draw do
  passwordless_for :users
  resources :users
end

rails routes

users        /users                 Passwordless::Engine {:authenticatable=>"user"}
GET    /users(.:format)       users#index
POST   /users(.:format)       users#create
new_user GET    /users/new(.:format)   users#new
edit_user GET    /users/:id/edit(.:format)   users#edit
user GET    /users/:id(.:format)   users#show
PATCH  /users/:id(.:format)   users#update
PUT    /users/:id(.:format)   users#update
DELETE /users/:id(.:format)   users#destroy

Thank you for your awesome gem.

mikker commented 4 years ago

Hi! Yes, this is a bit weird, see https://github.com/mikker/passwordless/issues/30#issuecomment-435142143