开发者

serve static assets from root without timestamp in rails

In order to customize the homescreen icon from my rails app on Apple touch devices, I need to serve an image out of the root.

I need something like

www.mywebsite.com/an_image.png

to serve up the image. I've deployed on开发者_运维知识库 Heroku, so I don't even know if it's possible to muck with the web server configuration. If there is, I'm all ears. If there's a way to do it all within rails that would work too.

Does anyone have any guidance on this?


Try putting an_image.png in your Rails app's public directory. There is no rule saying that all images must go in the images subfolder.


There is a folder in your public directory called images. myapp/public/images. Go ahead and stick the image in there.

You need to name your images according to how apply has it configured. Here is a snapshot of one of my apps:

serve static assets from root without timestamp in rails

You can see that it needs to follow this format in order to show up as the 'native app icon':

apple-touch-icon-72x72-precomposed.png
apple-touch-icon-72x72.png
...

Also google your specific devise and make sure you get the naming convention correct.

You probably want to add this to your header so your web-app looks like a native app:

<meta name="apple-mobile-web-app-capable" content="yes">
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜