1
我的一些html.erb文件非常长。由于多个属性和有时条件。Rails视图助手并在html.erb文件中格式化非常长的行
例如:
<div class="comment-container">
<div class="comments">
<div class="user-info"></div>
<span class="toggle-comments pull-right comment-activity <%= 'hidden' unless @item.comment_threads.size != @item.root_comments.size %>" data-id="<% item.id %>" data-commentid="<% comment.id %>" data-userid="<% user.id %>">
<i class="fa fa-comment-o fa-lg"></i>
</span>
</div>
</div>
什么是格式化这样的事情的最好方法?我应该使用content_tag
吗?就这样离开它?