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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -