Rails 5:活动存储 Link 添加 ?local=one

Rails 5: Active Storage Link Adds ?local=en

我有一个产品模型,通过 Active Storage 有很多图像

class Product < ApplicationRecord
 has_many_attached :images
end

我的 products/show 视图将第一张图片显示为 link 到显示所有其他图片的模式:

- 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

它在几分钟内运行良好。但不知何故,?locale=en 会在几分钟后从 Active Storage 添加到图像 link,这样图像就不会再显示了。

<img src="/rails/active_storage/blobs/longstring/image_file.jpg">

变成

<img src="/rails/active_storage/blobs/longstring/image_file.jpg?locale=en">

我的路线文件:

scope "(:locale)", locale: /en|ja/ do
  resources :products

如何防止 rails 添加 locale=en 到图像 link?

事实证明问题不是语言环境问题,而是通过此解决的其他问题:https://evilmartians.com/chronicles/rails-5-2-active-storage-and-beyond