这是代码
.meta
= time_ago_in_words(discussion.created_at)
ago by
= discussion.user.username
|
= link_to "Edit", edit_discussion_path(discussion), class: "meta"
|
= link_to "Delete", discussion_path(discussion), method: :delete, confirm: "Are you sure?", class: "meta"
这是输出:
<div class='meta'>
about 7 hours
ago by
foo
|
<a href="/discussions/2/edit" class="meta">Edit</a>
|
<a href="/discussions/2" class="meta" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
</div>
这使得输出在|
.
是否可以删除这些语句之间的空格,而不添加 aspan
到所有内容,或者只使用erb
or string interpolation
?