title: Rails 5: Active Storage Link Adds ?local=en
body: <p>I have a products model that has many images via Active Storage</p>
  
  <pre><code>class Product &lt; ApplicationRecord
   has_many_attached :images
  end
  </code></pre>
  
  <p>My products/show view shows the first image as a link to a modal that shows all the other images:</p>
  
  <pre><code>- if @product.images.present?
    = link_to image_tag(@product.images.first, class: "img-fluid"), "#", data: {toggle: "modal", target: "#images"}
    / or
    = link_to image_tag(url_for(@product.images.first)), "#", class: "img-fluid", data: {toggle: "modal", target: "#images"}
  
  
  #images.modal
    .modal-dialog
      .modal-content    
        .modal-body
          .carousel-inner
            .carousel-item.active
              = image_tag = @product.images.first, class: 'd-block w-100'
  
            - @product.images.drop(1).each do |image|
              .carousel-item
                = image_tag image, class: 'd-block w-100'
  
        a.carousel-control-prev data-slide="prev" href="#image_controls" role="button" 
          span.carousel-control-prev-icon
        a.carousel-control-next data-slide="next" href="#image_controls" role="button" 
          span.carousel-control-next-icon
  </code></pre>
  
  <p>It works well for a few minutes. But somehow, <code>?locale=en</code> gets added to the image link from Active Storage after a few minutes so that the image does not show anymore. </p>
  
  <pre><code>&lt;img src="/rails/active_storage/blobs/longstring/image_file.jpg"&gt;
  </code></pre>
  
  <p>becomes </p>
  
  <pre><code>&lt;img src="/rails/active_storage/blobs/longstring/image_file.jpg?locale=en"&gt;
  </code></pre>
  
  <p>My routes file:</p>
  
  <pre><code>scope "(:locale)", locale: /en|ja/ do
    resources :products
  </code></pre>
  
  <p>How do I prevent rails from adding <code>locale=en</code> to the image link?</p>