Rails 4 raw html_safe not working -


i not able escape raw html tags in view

<% array =  @article.tags.collect { |p| (link_to p.name, '#') } %> <%= array.join(' , ') %> 

raw , 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 output, without escaping html tags

<a href="#">tag1</a> , <a href="#">tag2</a> , <a href="#">tag4</a>  

this solved problem

<%= raw (@article.tags.map { |p| (link_to p.name, '#') }.join(' , ')) %> 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -