开发者

Rails-like routing framework

开发者 https://www.devze.com 2023-02-22 16:54 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消