V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xxy023
V2EX  ›  程序员

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

  •  
  •   xxy023 · 2018 年 8 月 8 日 · 1674 次点击
    这是一个创建于 2730 天前的主题,其中的信息可能已经有所发展或是发生改变。

    版本 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 年 8 月 10 日
    放弃了改源码,装了插件解决了需求
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3272 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:05 · PVG 19:05 · LAX 03:05 · JFK 06:05
    ♥ Do have faith in what you're doing.