I am not able to escape raw html tags in the view
<% array = @article.tags.collect { |p| (link_to p.name, '#') } %>
<%= array.join(' , ') %>
Raw and html_safe
<% array = @article.tags.collect { |p| raw (link_to p.name, '#') } %>
<% array = @article.tags.collect { |p| (link_to p.name, '#').html_safe } %>
Giving me this output, without escaping the html tags
<a href="#">tag1</a> , <a href="#">tag2</a> , <a href="#">tag4</a>
html_safe actually "sets the string" as HTML Safe (it's a little more complicated than that, but it's basically it). This way, you can return HTML Safe strings from helpers or models at will. h can only be used from within a controller or view, since it's from a helper. It will force the output to be escaped.
Safe HTML is a module that filter the input before the content is stored in the database. Unlike Drupal basic filtering system, Safe HTML filter the form post and perform code cleaning before the content is stored on the site backend.
It is much easier to tell if a ruby is real when it is raw and uncut, for a variety of reasons. Rubies like to grow in a flat, hexagonal shape. If the uncut gem shows this natural growth characteristic, along with parts of its host rock (marble or alkali basalt) still attached, it is very likely it is a real ruby.
This solved my problem
<%= raw (@article.tags.map { |p| (link_to p.name, '#') }.join(' , ')) %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With