I'm new to html.erb files and I didn't find an answer to my problem.
I have array of names and I'm trying to print them in a paragraph tag <p> in one line with ',' like that:
name1, name2, name3
But instead I get this:
name1,
name2,
This is the code:
<% @names_array.each do |name| %>
<p class="center"><%= name %>,</p>
<% end %>
spaninstead ofp, or changing the styling ofptodisplay:inline. w3schools.com/tags/tag_p.asp Also google for block vs inline html elements.