Rails的显示部分内容:
<%= (truncate(strip_tags(post.body), :length => 60, : omission => '...')).html_safe %>
Rails的转换时间格式:
<%= post.created_at.strftime("%B %d on %I:%M %p") %>
结果:June 22 on 04:35 AM
<%= (truncate(strip_tags(post.body), :length => 60, : omission => '...')).html_safe %>
Rails的转换时间格式:
<%= post.created_at.strftime("%B %d on %I:%M %p") %>
结果:June 22 on 04:35 AM