• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xxy023
V2EX  ›  程序员

请教一下关于 redmine 自动加载附件图片的问题

  •  
  •   xxy023 · Aug 8, 2018 · 1856 views
    This topic created in 2842 days ago, the information mentioned may be changed or developed.

    版本 redmine3.4.6,系统 windows server 8

    在网上搜到是在 apps\redmine\htdocs\app\views\attachments_links.html.erb 文件下加以下代码块,但是重启 redmine 之后图片预览失败,请问有人知道怎么解决吗?

    <% images = attachments.select { |a| a.image? } %>

    <% unless images.empty? %>

    <% images.each do |attachment| %> <%= link_to image_tag(url_for({:controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename })), {:controller => 'attachments', :action => 'show', :id => attachment, :filename => attachment.filename }, :class => 'lightbox', :rel => 'attachments', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }" %> <% end -%>
    <% end -%>
    xxy023
        1
    xxy023  
    OP
       Aug 10, 2018
    放弃了改源码,装了插件解决了需求
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1086 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:33 · PVG 02:33 · LAX 11:33 · JFK 14:33
    ♥ Do have faith in what you're doing.