Rails-like routing framework
is there any rails-like routing I can use in my non-rails app? I really like the way of defining url matching. So开发者_如何学Pythonmething like:
if matcher.match("/myapp/cart/:id/create")
puts matcher[:id]
end
Something similar. I would prefer simple solution to that. Maybe a snippet or reference to some code that can be used. Or a library. Thanks
You can do it with rack also
https://github.com/mynyml/simple_router
Sounds like Sinatra may be perfect for you:
http://www.sinatrarb.com/
If you just want sinatra like routes inside a rails app you may want to try sinatrify
astaire also seems to offer the same functionality but is not compatible with rails >= 3.2 with which i tried to use it.
精彩评论