ruby-on-rails-4spreespree-auth-devise

spree_fancy footer image change


I am creating an spree application. I want to change the footer image but I can not understand why I could not access the image tag in footer four columns. Is there any way to change footer image? And another one is, image source could not find image. Thanks in advance.

My update_footer is:

Deface::Override.new(:virtual_path => "spree/shared/_footer",
                     :name => "Change logo",
                     :replace => "div.four.columns img#footer-logo",
                     :text =>
                         '<img id="footer-logo" src="logo.png" alt=" Theme"></img>'
)

And the page: enter image description here


Solution

  • Deface operates on the ERB templates themselves not their output.

    The key line in the footer shows the following:

    <%= image_tag "spree/fancy/logo-white.png", :alt => "Spree Demo Theme", :id => "footer-logo" %>
    

    Your selector should instead be something like:

    :replace => "erb[loud]:contains('footer-logo')"
    

    as that is what is in the template.