I’ve setup a flash helper:
def flash_message
flash.each do |key, msg|
content_tag :div, msg, :id => key, :class => 'flash'
end
end
And I’ve put this in my application.html.erb:
<%= flash_message %>
And it’s returning content like this:
{:notice=>"Testing"}
I’m fairly new to rails so this could be an amateur mistake.
You’re right, it is an amateur mistake. 😉
Using .each here just iterates over the the messages and creates a div for each one. What you want is to make an array out of the divs and then concatenate them together at the end. Something like this: