0

I have images on an external CDN rather than my assets folder, but for some reason the background images on the following code aren't showing up:

<header class="py-5 bg-image-full bg-image-stripe" style="background-image: background-image: url('<%= @blog.featured_image_url %>')">
  <div class="container h-100">
    <div class="row h-100 align-items-center">
      <div class="col-lg-12">
        <h1 class="display-4 mt-5 mb-2"><%= @blog.title %></h1>
        <p class="lead mb-5"><%= @blog.teaser %></p>
        <p>
          <% @blog.tag_list.each do |tag| %>
            <%= link_to tag, tagged_path(tag: tag) %>
          <% end %>
          <br>
          <em>By <%= Spree::User.find(@blog.spree_user_id).email %> on <%= @blog.published_at.in_time_zone("America/Los_Angeles").strftime("%B %d, %Y") %></em>
        </p>
      </div>
    </div>
  </div>
</header>

I've double checked other SO posts (like this one) for syntax, but everything appears right. When I look at the Chrome inspector it gives me no relevant console errors, but I get this:

enter image description here

Any hints as to what's going wrong? The exact same code (with an asset path instead of a url) works elsewhere in my app, so I'm at a loss.

Liz
  • 1,369
  • 2
  • 26
  • 61

1 Answers1

1

This should be better with this part of code

<header class="py-5 bg-image-full bg-image-stripe" style="background-image: url('<%= @blog.featured_image_url %>')">
ronangr1
  • 57
  • 3