On Tue, Jul 29, 2008 at 8:43 AM, Sunny Bogawat
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> I have problem with truncation of text. My text includes html tags also.
> On main page I display only 100 characters of it, and give read more
> link to user. Now if within these 100 characters, if there is any html
> tag that is opening and not getting closed within 100 characters, then
> that html tag is getting displayed on main page.
>
> How can I solve this problem? Is there any solution for it?
Call strip_tags before truncating
See:
http://api.rubyonrails.com/classes/ActionView/Helpers/SanitizeHelper.html#M001620
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---