问题
Used firebug and inspected Spree default logo is coming from
/assets/store/logo.png
Checked in spree 2.1.3 Version Source code and found default logo is coming from /logo section.
path :
core/app/models/spree/app_configuration.rb
preference :logo, :string, default: 'logo/spree_50.png'
Trying to Override, the default logo using Spree:Config option.
Spree::Config.set(logo: "store/logo.png")
But it's still redirecting to the old image(spree_50.png) and I am unable to replace the default logo.
回答1:
In application.rb:
Spree.config do |config|
# Example:
# Uncomment to override the default site name.
# config.site_name = "Spree Demo Site"
config.logo = "logo.png"
end
Then add your logo to public/images/ and the logo will show up.
回答2:
You can place your image at this path.
Inside: app/assets/images/logo/"Your Image"
for eg. app/assets/images/logo/hi5_logo.png**
Inside: config/initializers/spree.rb
Spree.config do |config|
config.logo = "logo/hi5_logo.png" #for default store logo
config.admin_interface_logo = "logo/hi5_logo.png" #for admin logo
end
来源:https://stackoverflow.com/questions/20323347/unable-to-replace-spree-default-logo-in-spree-2-1-3