开发者

How to serve static content from gems in Sinatra (analagous to Rails ::ActionDispatch::Static)

I have a Sinatra service which includes a gem. The gem contains some static content which I would like to include in and serve via the Sinatra app.

In Rails this would be done with ActionDispatch. Here is an example: http://jonswope.com/2010/07/25/rails-3-engines-plugins-and-static-assets/

Is there 开发者_高级运维a way to do this in Sinatra without ActionDispatch? Or is there a clean way to do it via ActionDispatch in Sinatra?


Sinatra is Rack Applications. An easy way to serve static files is with Rack::Static. More examples in this SO question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜