2010-02-11 189 views
0

我正在开发Flex中的应用程序和Ruby on Rails。Ruby on Rails路由错误

有些时候它工作正常。但有时我得到路由错误。

错误:/index.htm “明明没有路由匹配 ”“ 与{:方法=>:得到}”

这里的index.html是我的登录页面

请帮我在这。

感谢, 拉维

+1

您可以编辑您的问题向我们展示了什么在你的'配置/ routes.rb'文件请。 – 2010-02-11 15:50:43

+0

ActionController :: Routing :: Routes.draw do | map | map.resources:snmpv3configs map.resources:snmpservers map.resources:iolatencyhistograms map.resources:tasksuppressions map.resources:alertoccurrences map.resources:alertconfigs map.resources:systemsettings map.resources:targetnames 地图的.resources:认证 map.resources:服务器 map.resources:iopathgroups map.resources:systemtypes map.resources:sensordetails map.resources:iolatencyconfigs map.resources:用户 map.resource:会议 地图的.resources:ioscopeevents – Ravikanth 2010-02-11 17:21:11

+0

map.resources:iolatencyresponses map.resources:iopaths map.resources:用户 map.resource:会话 map.signup '/注册',:控制器=> '用户', :动作=> '新' map.login '/登录',:控制器=> '会话', \t:动作=> '新' \t map.logout '/注销',:控制器=> '会话', \t: action =>'destroy' \t map.delete'/ delete',:controller =>'users', \t:action =>'destroy' \t map。编辑 '/编辑',:控制器=> '用户', \t:动作=> '更新' map.delete '/ deletegroup',:控制器=> 'iopathgroups', \t:动作> '破坏' \t map.editTarget '/ editTarget',:控制器=> 'Targetnames', – Ravikanth 2010-02-11 17:22:51

回答

2

如果你有一个静态文件public/index.html的那么这应该是担任了一个直接的请求是它使任何时间。路由引擎只是抱怨,因为没有定义该特定路径的路由。

检查事项:

  • 你有一个名为公共/ index.html的,可直接担任了?
  • 你有路由'/index.:format'的定义吗?
  • 了解您的路由是通过运行解释:耙路线

一个简单的方法来添加一个路由,这个特殊的动作,简单地说:

route.connect '/index.:format', :controller => 'login', :action => 'new' 

我通常添加一个包罗万象的路线在路由表的底部办理神秘网址:

route.connect '/*path', :controller => 'default', :action => 'not_routed'