If I call render_slider_items(["a.png", "b.png", "c.png"])
my webpage shows the array ["a.png", "b.png", "c.png"]
, not the html.
module ApplicationHelper
def render_slider_items(filenames)
filenames.each do |filename|
content_tag(:div, class: "col-md-3") do
tag("img", src: "assets/#{filename}")
end
end
end
end
What would cause this?
UPDATE - Solution-
def render_slider_items(filenames)
filenames.collect do |filename|
content_tag(:div, class: "col-md-3") do
tag("img", src: "assets/#{filename}")
end
end
end.join().html_safe