<%= error_messages_for :image %> <% form_for(:images, :url => galleries_path, :html => { :multipart => true, :onsubmit => "$('spinner').style.display = 'inline';" }) do |f| %>

Upload an image

<%= submit_tag "Create" %> <%= image_tag '/images/spinner.gif', :id => 'spinner', :style => 'display:none;' %>

<% end %> <% content_for :sidebar do -%> <%= new_image_link -%>
<% end -%>