How to add favicon in rails 3.2

Simply add this to the <head></head> section of your layouts:

<%= favicon_link_tag 'favicon.ico' %>

Place the favicon.ico image in /app/assets/images/ if you are using the asset pipeline, and in /public/images/ if you are not.

Also, there is a bug if using Ruby 2.0 with Rails 3.0.20 (and maybe also 3.0.x), that will throws an exception when trying to render favicon.ico.

The fix is to place the following code into application_controller.rb:

  config.relative_url_root = ""

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)