我有一个用户控制器。
对于特定用户,我想要这样的东西
example.com/a_constant_string ==> example.com/users/2
我只需要特定用户,而不是所有用户。你可以说
link_to 'Go to a specific user', @user
link_to 'Go to a specific user', user_path(@user)
link_to 'Go to a specific user', a_constant_string_path
应该是一样的。