Ruby on rails 3 Rails 3路由未获得任何路由匹配

Ruby on rails 3 Rails 3路由未获得任何路由匹配,ruby-on-rails-3,routing,Ruby On Rails 3,Routing,我在Rails 3.0.9下。 我有路线: get 'account/index' 控制台上有这样的信息: account_index GET /account/index(.:format) {:controller=>"account", :action=>"index"} 但是当我尝试http://127.0.0.1:3000/account/, 我得到没有路线匹配“/帐户” 提前感谢。是的,因为路由是/account/index而不是/account 尝试get

我在Rails 3.0.9下。

我有路线:

get 'account/index'
控制台上有这样的信息:

account_index GET    /account/index(.:format)   {:controller=>"account", :action=>"index"}
但是当我尝试http://127.0.0.1:3000/account/
我得到没有路线匹配“/帐户”


提前感谢。

是的,因为路由是/account/index而不是/account
尝试
get'account#index'

@Lesha,我对Rails也比较陌生。以下是路由文件中更通用的方法,而不是get“controller”action

完成此操作后,您必须使用

访问您的页面,请参阅以获取更详细的说明。此外,以下行(match:to=>)应该位于routes.rb文件的顶部,然后再
match::controller(/:action(/:id))(:format)
。希望这有帮助

match '/account', :to => 'account#index'

索努,非常感谢你的建议。但是它不适合我,因为我不想引用@LeshaPipiev,在您的routes.rb文件中输入前面的建议后,您可以尝试以下内容吗``匹配“/account”,to=>“account#index”`谢谢蒂姆。但当我尝试获取“帐户索引”时,我发现缺少:控制器错误。但是使用match'account'=>'account#index',:via=>:get解决了我的问题。但这不是我所需要的。
match '/account', :to => 'account#index'