Answer the question
In order to leave comments, you need to log in
Invalid users_path
Hello. The problem is this: users_path(user) returns the string '/users.1' when it should return '/users/1' . Please tell me how can I fix this?
routes.rb:
# USERS
match '/signup', to: 'users#new', via: 'get'
match '/users/:id', to: 'users#show', via: 'get'
match '/users', to: 'users#create', via: 'post'
match '/users/:id/edit', to: 'users#edit', via: 'get'
match '/users/:id', to: 'users#update', via: 'patch'
match '/users/:id', to: 'users#destroy', via: 'delete'
Answer the question
In order to leave comments, you need to log in
Try with explicit prefix
# routes.rb
get '/users/:id' => 'users#show', as: :users_show
# и вызов
users_show_path(user)
That's right, just wrote it in the wrong place. Write it already in an already existing path, before d.<path style="fill:#65C178;" d=""/>
So fill needs to be added to the path to which you change the color, and you have some kind of path there, which is nowhere to be seen. Add next.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question