annotate app/views/pastes/_form.html.erb @ 40:a81fb558f954

root_path is new_paste_path. Not aliased because it's :effort:.
author Edho Arief <edho@myconan.net>
date Thu, 04 Oct 2012 02:09:46 +0700
parents a930c717654c
children 8ef70e8c239d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 <%= form_for(@paste) do |f| %>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
2 <% if @paste.errors.any? %>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
3 <div id="error_explanation">
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
4 <h2><%= pluralize(@paste.errors.count, "error") %> prohibited this paste from being saved:</h2>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
5
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
6 <ul>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
7 <% @paste.errors.full_messages.each do |msg| %>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8 <li><%= msg %></li>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
9 <% end %>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
10 </ul>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
11 </div>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
12 <% end %>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
13
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
14 <div class="field">
35
e09a3be8dd14 Hardcoded rows.
Edho Arief <edho@myconan.net>
parents: 29
diff changeset
15 <%= f.text_area :paste, :class => 'span12', :rows => 10 %>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
16 </div>
29
5cfc0b956083 Better action area.
Edho Arief <edho@myconan.net>
parents: 28
diff changeset
17 <div class="form-actions">
5cfc0b956083 Better action area.
Edho Arief <edho@myconan.net>
parents: 28
diff changeset
18 <%= f.submit :class => 'btn btn-primary' %>
39
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 35
diff changeset
19 <%= link_to 'Clear', root_path, :class => 'btn', :id => 'reset_paste' %>
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
20 </div>
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
21 <% end %>