2011-02-18 53 views
0
class UsersController < ApplicationController 

    def edit 
    ... 
    end 

畝的routes.rbRails的路線問題

match '/user/:id/profile/edit', :to => 'users#edit', :as => "user_profile_edit", :via => "get" 

我的鏈接:

<%= link_to image_tag("icons/run.png"), user_profile_edit_path %> 

例外:

No route matches {:controller=>"users", :action=>"edit"} 

我做錯了嗎? 謝謝。

+0

您是否嘗試過刪除/資料/從你的路線。還要確保你已經設置了資源。 – Zinc 2011-02-18 11:30:25

回答

1

您需要提供用戶記錄。 假設記錄被分配到@user

<%= link_to image_tag("icons/run.png"), user_profile_edit_path(@user) %> 
+0

該死!當然,對於愚蠢的問題抱歉! – 2011-02-18 13:17:36