Hi,
For my rails app, I use a fixed layout with 2 columns (a main and a rightside). For now, flash messages are displayed in the content div but I would like to show flash msg in the "main" div ( main < content < container ).
I don't know what it the best to do it. In fact, did I have to create a flash message helper and add it in all my views, did I have to create a partial, to change something with the layout or is there another solution?
Here is my application.html.erb structure:
...
<body>
<div id="container">
<%= render 'layouts/header' %>
<div id="content">
<% flash.each do |name, msg| %>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
<% end %>
<%= content_tag :h1, yield(:title) if show_title? %>
<%= yield %>
</div>
<%= render 'layouts/footer' %>
</div>
</body>
...
and for example one of my views: (home/index.html.erb)
<div id="rightside">
...
</div>
<div id="main">
... <-- Here I want to display flash!
</div>
Thanks for any suggestions!