# New to list, question about html formatting with Ruby using

**URL:** <https://www.ruby-forum.com/t/new-to-list-question-about-html-formatting-with-ruby-using/81234>\
**Category:** Ruby\
**Created:** [January 6, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/new-to-list-question-about-html-formatting-with-ruby-using/81234 "2007-01-06T19:30:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [January 6, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/new-to-list-question-about-html-formatting-with-ruby-using/81234/1 "2007-01-06T19:30:30Z")

</div>

Hi all,

I am trying to figure out a way to not chop off my text mid-word using  
truncate() and redcloth.

index.rhtml  
article\_html is formatted with RedCloth  
\<%= truncate(post.article\_html, 80) %\>

I have a db table named Articles with (along with others) 2 columns  
“article\_text” and “article\_html”  
article\_html get’s populated by using a simple method with redcloth in  
the  
model

show.rhtml  
  
def before\_save  
self.article\_html = RedCloth.new(self.article\_text).to\_html  
end

There are 2 views, index.rhtml and show.rhtml.

I call article\_html  
the main index view, I want to truncate article\_html to only display the  
first paragraph

blah …

  
and then of course the link to “show” will display the full article.

I’ve done stuff similar using textile with python, but I want to know  
the  
“Ruby Way” to do this.

I figure this is pretty basic that you can give me an example with out  
me  
pasting code, but if you need let me know and I will post it.

Thanks
