Something seems to be wrong with my routing routes. Usually I have to do something like <%= link_to Profile, user_path(@user||current_user) %>, and I continue my day. For some reason, I do not understand that mine is user_pathnot returning /user/:id, as I would expect it. Instead, it returns. /user.:id
To test this, I downloaded a partial code with the following code.
application / view / users / _test.html.rb
<%= @user %><br>
<%= @user.id %><br>
<%= link_to user_path(@user), user_path(@user) %><br>
<%= new_user_path %><br>
<%= edit_user_path(@user) %><br>
<%= url_for(@user) %>
It returned
local: 3000 / test
1
/user.1
/users/new
/users/1/edit
/user.1
, . edit_user_path(@user) , . Rails Routing Guide , . , , - Rails 3.1 Devise, Devise (, ?).
? (, , , ), , . ?
, , , , .
/routes.rb
Rails.application.routes.draw do
root 'static#home'
%w( 404 406 422 500 503 ).each do |code|
get code, :to => "errors#show", :code => code
end
get '/test' => 'users#test'
get '/signup' => 'users#new'
post '/user' => 'users#create'
get '/user/list' => 'users#index'
post '/user/' => 'users#update'
get '/user/:id' => 'users#show'
get 'profile', to: 'users#show'
resources :users
end