With this code
<dd><%= textilize @box.description %></dd>
browser shows
<p>description text</p>
How i can hide the
tags??
With this code
<dd><%= textilize @box.description %></dd>
browser shows
<p>description text</p>
How i can hide the
tags??
It depends on your requirements. If you don't want block-level tags in general, you can use lite mode:
From the docs: http://redcloth.rubyforge.org/classes/RedCloth/TextileDoc.html
Otherwise, I've done something for markdown where I've allowed a very restricted set of tags and only allowed block elements if there are newlines in the original text something like this:
Tweak to suit!
See also this old thread https://www.ruby-forum.com/topic/175551 which mentions a method textilize_without_paragraph() from Rails pre-3 which moved to a now-abandoned gem. Perhaps the code there would help you: https://github.com/dtrasbo/formatize/blob/master/lib/formatize/helper.rb
EDIT: Ah, I see from comments that have since appeared on the question that you were seeing the actual tag text being rendered and seem to be happy with using html_safe and keeping the paragraph tags in the HTML rather than getting rid of them completely which is what I assumed you wanted. Oh well! Perhaps I'll leave this answer for posterity.