ruby on rails - How can I hide HTML tags? -


I am using a form to post to a blog on the blog post post page, to explain html I use the == on the rail material display tag.

However, I have a blog index page that shows the latest posts, I want a shaded post preview not to interpret the HTML, but hide the HTML tag at the same time.

How can I do this?

  def blog # @ content3 = content.find (3) @blogPosts = Blogpost.all.reverse.drop (1) @latestPost = Blogpost.last If @latestPost is empty? == Incorrect @ BlogPicture = Blogpost.list.impress the end of the IMF. Format | | Format.html {Render: Layout = & gt; 'Blog'} End End  

You full_sanitizer and then truncate results.

example (used in controller):

  sanitized = ActionView :: Base.full_sanitizer.sanitize (@string) @ trunket = ActionView :: helper :: TextHelper.truncate (Approved, Length: 17)  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -