我有以下内容projects_controller
:
def edit
@project = Project.find(params[:id])
@project.current_step = @project.first_step
@user = current_user
end
我的以下路线routes.rb
:
resources :users do
resources :projects
end
在我的views/users/show.html.erb
我有:
<%= link_to image_tag('img_blank.png'), edit_user_project_path, :class => "btn_edit_project" %>
并rake routes
给我:
...
edit_user_project GET /users/:user_id/projects/:id/edit(.:format) projects#edit
...
我仍然收到错误:
`Routing Error: No route matches {:action=>"edit", :controller=>"projects"}`
我对此束手无策。有什么帮助吗?