<%= message.content %>
I can display a message like this, but in some situations I would like to display only the first 5 words of the st
# Message helper def content_excerpt(c) return unlessc c.split(" ")[0..4].join + "..." end # View <%= message.content_excerpt %>
But the common way is truncate method
# Message helper def content_excerpt(c) return unless c truncate(c, :length => 20) end