diff options
Diffstat (limited to 'app/views/snippets/_form.html.erb')
-rw-r--r-- | app/views/snippets/_form.html.erb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/views/snippets/_form.html.erb b/app/views/snippets/_form.html.erb new file mode 100644 index 0000000..1c37b00 --- /dev/null +++ b/app/views/snippets/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_for(snippet) do |f| %> + <% if snippet.errors.any? %> + <div id="error_explanation"> + <h2><%= pluralize(snippet.errors.count, "error") %> prohibited this snippet from being saved:</h2> + + <ul> + <% snippet.errors.full_messages.each do |message| %> + <li><%= message %></li> + <% end %> + </ul> + </div> + <% end %> + + <div class="field"> + <%= f.label :title %> + <%= f.text_field :title %> + </div> + + <div class="field"> + <%= f.label :code %> + <%= f.text_area :code %> + </div> + + <div class="actions"> + <%= f.submit %> + </div> +<% end %> |