【问题标题】:How to put %span inside of =link_to helper? [duplicate]如何将 %span 放入 =link_to 助手中? [复制]
【发布时间】:2013-07-11 13:19:25
【问题描述】:
= link_to t('actions.convert_to_template'), convert_backup_path(backup), {:title=> t('.convert_backup'), :class => 'icon convert_to_template'}  if backup.built? && authorized?(backup, :update)

如何将 %span t('actions.convert_to_template') 放入此链接至

【问题讨论】:

    标签: haml


    【解决方案1】:

    做一个助手,像这样

    def convert_to_template_text
      html = content_tag :span, t('actions.convert_to_template')
      html.html_safe
    end
    

    use block with link_to

    【讨论】:

      猜你喜欢
      • 2014-11-03
      • 1970-01-01
      • 2015-01-13
      • 1970-01-01
      • 1970-01-01
      • 2021-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多