0
我正在使用Rail 4.2.5和Foundation 6.我試圖關閉一條警報消息,但似乎沒有關閉該順暢效果;這只是一個接近尾聲。原始HTML,這樣的作品,是:Foundation_6提醒消息content_tag
<div class="alert callout" data-closable>
<h5>This is Important!</h5>
<p>But when you're done reading it, click the close button in the corner to dismiss this alert.</p>
<p>I'm using the default <code>data-closable</code> parameters, and simply fade out.</p>
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
<span aria-hidden="true">×</span>
</button>
</div>
在我application.html.erb
,我想content_tag
複製:
<% flash.each do | name, message | %>
<%= content_tag :div, class: "#{name} callout", :"data-closable" => "data-closable" do -%>
<%= message %>
<%= link_to('', html_options = {:"data-label" => "Dismiss alert" , :"data-close" => "data-close" }, class: "close-button") do-%>
<span aria-hidden="true">×</span>
<% end -%>
<% end -%>
<% end -%>
謝謝!全部淡化。 – Sylar