comparison app/views/pastes/show.html.erb @ 265:6cca1ab53337

Infinitely better error messages and notice.
author edogawaconan <me@myconan.net>
date Wed, 16 Oct 2013 02:56:30 +0900
parents fa4a1ba990ae
children 77c157a9e645
comparison
equal deleted inserted replaced
264:fa4a1ba990ae 265:6cca1ab53337
1 <% provide :title, "Paste ##{@paste.id}" %> 1 <% provide :title, "Paste ##{@paste.id}" %>
2 2
3 <% if flash[:error] %> 3 <% if alert %>
4 <div class="alert alert-error"> 4 <div class="alert alert-danger">
5 <%= flash[:error] %> 5 <%= alert %>
6 </div> 6 </div>
7 <% end %> 7 <% end %>
8 8
9 <div class="page-header"> 9 <div class="page-header">
10 <h1><%= content_for :title %></h1> 10 <h1><%= content_for :title %></h1>
29 </div> 29 </div>
30 </div> 30 </div>
31 </div> 31 </div>
32 32
33 <%= form_for @paste, :method => :delete do |f| %> 33 <%= form_for @paste, :method => :delete do |f| %>
34
34 <div class="row"><div class="col-md-4"> 35 <div class="row"><div class="col-md-4">
35 <div class="input-group"> 36 <div class="input-group">
36 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :class => "form-control", :autofocus => !flash[:error].blank? %> 37 <%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :class => "form-control", :autofocus => f.object.errors.any? %>
37 <span class="input-group-btn"> 38 <span class="input-group-btn">
38 <%= f.submit 'Delete this paste', :class => 'btn btn-danger' %> 39 <%= f.submit 'Delete this paste', :class => 'btn btn-danger' %>
39 </span> 40 </span>
40 </div> 41 </div>
41 </div></div> 42 </div></div>