我遇到了问题,创建了正确的路线。我想传递我正在处理的元素的id,但它看起来不正确。创建一条简单的路线
我的路线看起来像
resources :accounts
match 'account-audit' => 'accounts#audited',:as => :accountaudit
,当我做耙路线我得到
accounts GET /accounts(.:format) accounts#index
POST /accounts(.:format) accounts#create
new_account GET /accounts/new(.:format) accounts#new
edit_account GET /accounts/:id/edit(.:format) accounts#edit
account GET /accounts/:id(.:format) accounts#show
PUT /accounts/:id(.:format) accounts#update
DELETE /accounts/:id(.:format) accounts#destroy
accountaudit /account-audit(.:format) accounts#audited
,当我去到该页面的链接看起来
本地主机:3000 /帐户-audit.3
,它应该像
本地主机:3000 /帐号/ 3 /审计
如何让我的路线做我需要做什么?
我是个肯定的作品,但我最终使用 '匹配“/ account /:id/audit'=>'accounts#audited',:as =>:accountaudit' – MZaragoza 2012-07-23 13:57:33