lunaclaire
2008-Feb-06 18:15 UTC
helpers for truncating text based on number of lines to display?
I have a number of situations where I have a list of items to show where each item listed will show some details (e.g. title) and a summary block of text. The user can click to view the item by itself for more details, full text, and editing. Up til now I''ve been using truncate() to clip the text for summary to some char count and guessing what will result in my desired 2 or 3 lines of summary text. But this isn''t really very good because I can never be assured of the number of lines that will result due to where the lines break on the text and differences in rendered text size in diff browsers. Are there helpers or code snippets that address this situation? Something in rails? Something in javascript? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---