在link_to调用中嵌入了额外的HTML

如何在link_to调用中嵌入其他HTML?

这是我想要的结果:

Show 

这是我的link_to电话

  

 <%= link_to ' Show'.html_safe, exercise_path(exercise), :class => 'btn btn-small' %> 

.html_safe是必需的,以便它不会被转义。

如果将它包装在do块中则更干净

<%= link_to exercise_path(exercise) do %> Show <% end %>