【发布时间】:2011-05-18 19:35:37
【问题描述】:
我刚刚在我的 rails (v3.0.1) 应用程序中设置了 Sinatra v1.1.0。但我不能调用任何深度超过 1 级的路由,这意味着这有效 - http://localhost/customer/3,
但这个不起作用 - http://localhost/customer/3/edit 我收到“路由错误”
这是 Sinatra 对象
class CustomerApp < Sinatra::Base
# this works
get "/customer/:id" do
"Hello Customer"
end
# this does NOT work
get "/customer/:id/edit" do
"Hello Customer"
end
end
这就是我在 rails routes.rb 文件中的内容 -
match '/customer/(:string)' => CustomerApp
我猜我需要在路由文件中添加一些魔法?可能是什么问题?
【问题讨论】:
-
routes.rb 文件中有大量示例被注释掉了。
标签: ruby-on-rails sinatra