简体   繁体   中英

How to upload image to assets? Can I do it without adding paperclip?

From what I read it seems I need a gem, like paperclip to upload my favicon image.

In application.html.erb I have:

<link href="favicon.ico" rel="icon" type="image/x-icon" />

Then under assets/images I created the file: favicon.ico

I just don't know what to put in the file to make the favicon work. Adding paperclip seems like a lot of work for one 16 pixel image.

You don't need any gem for that... just add you favicon to the assets folder and add the following line to the application layout:

<%= favicon_link_tag 'favicon.ico' %>

docs: http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/favicon_link_tag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM