Fav Icon in Rails 3.2

0 Shares
0
0
0
  1. Put the favicon.ico under your public/ folder
  2. Add <%= favicon_link_tag '/favicon.ico' %> to your <head></head>
  3. Create your helper method for favicon_link_tag  under a helpers folder in library with the following code:
Path => File actionpack/lib/action_view/helpers/asset_tag_helper.rb

Method: def favicon_link_tag(source='/favicon.ico', options={}) tag('link', { :rel => 'shortcut icon', :type => 'image/vnd.microsoft.icon', :href => path_to_image(source) }.merge(options.symbolize_keys)) end

Or a easier but not that professional way:

  1. Host your image on amazon S3 or any other by your preference 
  2. Add the url of your image in a link 
  3. Add the link  to your head  (under application.html.erb)

Example: <link rel=“shortcut icon” href=“https://s3-us-west- amazonaws.com/techwomencomingsoonpage/favicon.ico>

0 Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like
RESTful routes Here is a good  cheatsheet to take for anyone who is a beginner and its trying…
Read More