Also if you don't want to use the textilize helper because you want to
include your own options then you can make your own helper using the
same code from the textilize helper and throw in your options.
ie:
def textilize_with_filter_no_paragraph(text)
if text.blank?
""
else
textilized = RedCloth.new(text, [:filter_html])
textilized.hard_breaks = true if
textilized.respond_to?(:hard_breaks=)
textiled = textilized.to_html
if textiled[0..2] == "<p>" then textiled = textiled[3..-1] end
if textiled[-4..-1] == "</p>" then textiled = textiled[0..-5] end
return textiled
end
end
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---