【发布时间】:2011-02-18 23:41:09
【问题描述】:
所以我有一个用户控制器,并且它(除其他外)有一个名为 details 的函数。
这个想法是用户可以去 localhost:3000/user/:user_id/details 并能够查看:user_id的详细信息。
例如,我有一个名为“tester”的用户。
当我去uri时:http://localhost:3000/users/tester/details
我希望调用 details 函数,呈现详细信息视图,并为用户测试人员显示信息。
但是我得到一个错误提示
No action responded to tester. Actions: change_password, create, current_user, details, forgot_password, index, login_required, new, redirect_to_stored, show, and update_attributes
我理解这基本上意味着如果我想访问详细信息,我真的应该使用
http://localhost:3000/users/details
除了那也不是真的有效... >.http://localhost:3000/users/details/registries
(这是我为任何试图查看 users/:user_id 的人规定的默认路径,所以再一次,这是我想要的方式)
要点是:任何人都可以帮助并告诉我如何才能获得
users/:user_id/details 以我希望的方式工作并显示 :user_id 的详细信息?
谢谢!
【问题讨论】:
标签: ruby-on-rails routes