I am solving situation about printing data from array via each loop.
in my controller
@dost_arr = ["aaab", "bbb", "ccc"]
in view
<% @dost_arr.each do |i| %>
<%='<tr class="show_lines">'.html_safe%>
<%='<td colspan="2">x'+ (link_to i, request.request_uri+'&d=0')+'</td>'%>
<%='</tr>'%>
<%end%>
But this generate me something like this
<td colspan="2">x<a href="/hledani/index?utf8=%E2%9C%93&n
as source code, so I see in browser and not own data from array formatting into table…
Can anyone help me, please, what I am doing wrong?
Thank you
Why do you put html code inside ruby code? Use something like this: