view app/views/pastes/_form.html.erb @ 264:fa4a1ba990ae

Simplified pastes#show view.
author edogawaconan <me@myconan.net>
date Wed, 16 Oct 2013 02:19:36 +0900
parents c4aba8990c5e
children 6cca1ab53337
line wrap: on
line source

<%= 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>

      <ul>
      <% @paste.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="form-group">
    <%= f.text_area :paste, :rows => 10, :class => "form-control" %>
  </div>

  <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 %>