changeset 260:c4aba8990c5e

Fix new paste form.
author edogawaconan <me@myconan.net>
date Tue, 15 Oct 2013 21:52:08 +0900
parents 5d084a9716ca
children f057e8c78e50
files app/views/pastes/_form.html.erb
diffstat 1 files changed, 16 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/pastes/_form.html.erb	Tue Oct 15 21:51:57 2013 +0900
+++ b/app/views/pastes/_form.html.erb	Tue Oct 15 21:52:08 2013 +0900
@@ -1,4 +1,4 @@
-<%= form_for(@paste) do |f| %>
+<%= form_for @paste do |f| %>
   <% if @paste.errors.any? %>
     <div class="alert alert-error" id="error_explanation">
       <h5><%= pluralize(@paste.errors.count, "error") %> prohibited this paste from being saved:</h5>
@@ -11,27 +11,22 @@
     </div>
   <% end %>
 
-  <div class="field">
-    <%= f.text_area :paste, :class => 'span12', :rows => 10 %>
-
-    <div class="form-horizontal">
-      <div class="control-group">
-        <%= f.label :key, "Deletion key", class: "control-label" %>
-        <div class="controls">
-          <%= f.text_field :key %>
-        </div>
-      </div>
-      <div class="control-group">
-        <%= f.label :is_private, "Make private", class: "control-label" %>
-        <div class="controls">
-          <%= f.check_box :is_private %>
-        </div>
-      </div>
-    </div>
+  <div class="form-group">
+    <%= f.text_area :paste, :rows => 10, :class => "form-control" %>
   </div>
 
-  <div class="form-actions">
-    <%= f.submit :class => 'btn btn-primary' %>
-    <%= link_to 'Clear', root_path, :class => 'btn', :id => 'reset_paste' %>
+  <div class="form-group">
+    <%= f.label :key, "Deletion key", class: "control-label" %>
+    <div class="row"><div class="col-sm-3">
+      <%= f.text_field :key, :class => "form-control" %>
+    </div></div>
   </div>
+  <div class="checkbox">
+    <%= f.label :is_private do %>
+      <%= f.check_box :is_private %>
+      Private
+    <% end %>
+  </div>
+  <%= f.submit :class => 'btn btn-primary' %>
+  <%= link_to 'Clear', root_path, :class => 'btn btn-danger', :id => 'reset_paste' %>
 <% end %>