> On my app I allow users to post comments. I''m afraid some user
might
> post something like this:
>
> "whateveeeeeeeeeeee...eeeeeeer"
>
> This will stretch my page and mess up my entire layout. Rails''
> break_word helper doesn''t work in this case, so how I avoid this,
> using either Ruby or CSS?
You can truncate the string to a maximun length using:
<%= truncate(@comment_text,max_length) %>
Or do by your hand some code that break long words (using a space and a
minus) if they are longer than a length and then use word_wrap (it takes
the spaces into account)...
--
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
-~----------~----~----~----~------~----~------~--~---