tag:blogger.com,1999:blog-1561790335794640631.post3893484756498642823..comments2022-12-03T23:55:21.239-08:00Comments on Srikanth Jeeva's technical Blog: HTML stripping, Truncating string in Ruby, RailsSrikanth Jeevahttp://www.blogger.com/profile/12515460428559059354noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1561790335794640631.post-3934594176617419612017-04-19T04:08:47.626-07:002017-04-19T04:08:47.626-07:00Thanks, i tried many options but this finally work...Thanks, i tried many options but this finally worked. <br /><%= truncate(strip_tags(product.description), :length => 80) %>walsh259https://www.blogger.com/profile/06269626776762893808noreply@blogger.comtag:blogger.com,1999:blog-1561790335794640631.post-60493240552617704252011-01-03T04:44:16.947-08:002011-01-03T04:44:16.947-08:00In Rails 3.0 you have a helper strip_tags. Example...In Rails 3.0 you have a helper strip_tags. Example: you have a product and you want to show the description you do it in a line of code <br /><%= truncate(strip_tags(product.description), :length => 80) %><br /><br />By the way you can use SyntaxHighlighter to make the code from your blogspot pretty. http://alexgorbatchev.com/SyntaxHighlighter/Timurhttps://www.blogger.com/profile/14594716207428319651noreply@blogger.com