Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save christianvuerings/eae06968344205cb2a90 to your computer and use it in GitHub Desktop.

Select an option

Save christianvuerings/eae06968344205cb2a90 to your computer and use it in GitHub Desktop.
Moving to app/assets/templates doesn't render the .erb file correctly

Before

app/views/templates/404.html.erb

<%= image_tag "glass_magnifying_200x175.jpg", :size => "200x175", :alt => "", :class => "cc-right" %>

After

app/assets/templates/404.html

<div class="cc-right cc-page-status-magnifying"></div>
.cc-page-status-magnifying {
    background-image: asset-url("glass_magnifying_200x175.jpg");
    height: 175px;
    width: 200px;
}

For some reason app/assets/templates/404.html.erb doesn't seem to work with image_tag, it doesn't get parsed by rails. Is there something in the configuration that we need to set up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment