尝试使用 content_tag 创建以下内容:
<p><span class="field-label">Address: </span><%= @patient.address1 %></p>
<%= content_tag :p, @patient.address1 do %>
<%= content_tag :span, "Address: ", :class => 'field-label'%>
<%end%>
这将返回:
<p><span class='field-label>Address: </span></p>