diff app/views/layouts/_alerts.html.erb @ 385:62fef621f39c

Move alerts to layout.
author nanaya <me@myconan.net>
date Sun, 07 Jun 2015 10:13:25 +0900
parents 2ad092e60975
children 16f1b4f8ce94
line wrap: on
line diff
--- a/app/views/layouts/_alerts.html.erb	Sun Jun 07 02:59:29 2015 +0900
+++ b/app/views/layouts/_alerts.html.erb	Sun Jun 07 10:13:25 2015 +0900
@@ -1,13 +1,13 @@
-<% if params[:notice] %>
+<% if notice %>
   <div class="alert alert-info">
     <strong>Info:</strong>
-    <%= params[:notice] %>
+    <%= notice %>
   </div>
 <% end %>
 
-<% if @paste && @paste.errors.any? %>
+<% if alert %>
   <div class="alert alert-danger">
     <strong>Error:</strong>
-    <%= @paste.errors.full_messages.to_sentence %>
+    <%= alert %>
   </div>
 <% end %>