From: Lars Haugseth Date: 2012-08-30T15:15:39+09:00 Subject: Re: String in rails and ruby show first n character On 08/29/2012 08:34 PM, Bartosz Dziewo��ski wrote: > Use String#[]: http://www.ruby-doc.org/core-1.9.3/String.html#method-i-5B-5D > > <%= f.description[0, 200] %> In Rails, you can also utilize the truncate helper method: <%= truncate(f.description, :length => 200, :separator => ' ') %> This will ensure the string is not chopped off in the middle of a word. http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate -- Lars Haugseth