However thank you all,
 I found solution, I write few lines in posts helper and everything
works fine
 module PostsHelper
def wrap(content)
    content.split.map{ |s| wrap_long_string(s) }.join(' ')
  end

  private

    def wrap_long_string(text, max_width = 30)
      zero_width_space = "​"
      regex = /.{1,#{max_width}}/
      (text.length < max_width) ? text :
 
text.scan(regex).join(zero_width_space)
    end

end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to