Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created July 30, 2013 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemcalilly/cd0fd518c1b47d9bfb62 to your computer and use it in GitHub Desktop.
Save leemcalilly/cd0fd518c1b47d9bfb62 to your computer and use it in GitHub Desktop.
<%= form_for @photo, :html => {:multipart => true} do |f| %>
<% if @photo.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@photo.errors.count, "error") %> prohibited this photo from being saved:</h2>
<ul>
<% @photo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<fieldset>
<legend>Upload a Photo</legend>
<div class="field">
<%= f.file_field :image %>
</div>
</fieldset>
<%= f.submit "Upload Photo", :class => "btn btn-small" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment