Ruby on rails 没有与自定义路由匹配的路由
我正在为我的用户配置文件配置一个名为profile.html.erb的自定义页面 我正在吃晚饭Ruby on rails 没有与自定义路由匹配的路由,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我正在为我的用户配置文件配置一个名为profile.html.erb的自定义页面 我正在吃晚饭 No route matches {:action=>"profile", :controller=>"users"} 在路线方面,我有: resources :users do member do get :profile end end 我的用户\u controller.rb def profile @user = User.find(params[:id])
No route matches {:action=>"profile", :controller=>"users"}
在路线方面,我有:
resources :users do
member do
get :profile
end
end
我的用户\u controller.rb
def profile
@user = User.find(params[:id])
render 'profile'
end
此行出现错误:
<li><%= link_to "Profile", profile_user_path %></li>
profile.html.erb正在以我可以访问的方式工作
http://localhost:3000/users/1/profile
由于这是一个成员路由,因此需要提供成员 正在做
如果不向用户提供,则将是一个集合的路由。由于这是一个成员路由,您需要提供该成员 正在做 如果不向用户提供,这将是一个集合的路由
http://localhost:3000/users/1/profile