V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xxy023
V2EX  ›  程序员

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

  •  
  •   xxy023 · 2018-08-08 15:07:51 +08:00 · 1232 次点击
    这是一个创建于 2050 天前的主题,其中的信息可能已经有所发展或是发生改变。

    版本 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
       2018-08-10 15:20:22 +08:00
    放弃了改源码,装了插件解决了需求
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5435 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 08:28 · PVG 16:28 · LAX 01:28 · JFK 04:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.