railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.9k stars 2.26k forks source link

Favicon is not customizable #2743

Open skalee opened 8 years ago

skalee commented 8 years ago

Right now there's no option to configure a favicon for admin panel. IMHO setting a distinctive favicon for admin panel makes live easier.

I can prepare a pull request with required changes, however I wanted to discuss the feature and synopsis first. IMHO following one is totally enough:

RailsAdmin.config do |config|
  config.favicon = "favicon-admin.ico"
end

Favicon would be inserted with #favicon_link_tag rails helper method.

Although mobile Safari prefers favicons in png, I don't think that supporting it is worth of making things more complicated. And honestly, I am not sure what syntax would be best in that case. Anyway, one can always override the layout template.

thedanielhanke commented 8 years ago

@skalee do you want to have different favicons for the actual site (if any) and the admin?

i personally could not care less for which favicon is presented, further i find it hard to imagine that this feature is worth a implementation or even belonging to rails_admin (because it feels super special).

however, if a client would insist, id sue thetheming` functionality and add it via javascript.

(function() {
    var link = document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = 'http://www.stackoverflow.com/favicon.ico';
    document.getElementsByTagName('head')[0].appendChild(link);
}());