当前头像：<%= image_tag @user.avatar.url(:middle) %>
<%= form_for @user, :url => user_path, :html => { :multipart => true } do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
        <% @user.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  <%= f.file_field :avatar %>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>