2013-05-29 88 views
0

我在我的rails應用程序中使用devise來註冊/註冊。在註冊時,我想將用戶重定向到其個人資料頁面。設計/ Rails:after_sign_up_path_for(資源)

我做耙路線及編輯,根源是:

/profiles/:id/edit 

我在註冊控制器寫了這個:

def after_sign_up_path_for(resource) 
'http://localhost:3000/profiles/#{resource.id}/edit' 
end 

但它無法正常工作。任何人都可以幫忙嗎?

回答

3

你不應該使用:

def after_sign_up_path_for(resource) 
    edit_profile_path(resource) 
end 

,而不是硬編碼http://localhost:3000/profiles/#{resource.id}/edit

將是有益的有你的路由文件張貼過。