如何将%span放在= link_to helper中?

时间:2013-07-11 13:19:25

标签: haml

= 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')放在此link_to

1 个答案:

答案 0 :(得分:0)

像这样做一个帮手

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

use block with link_to