= form_for(@friend, multipart: true) do |f|
  - if @friend.errors.any?
    #error_explanation
      %h2
        = pluralize(@friend.errors.count, "error")
        prohibited this friend from being saved:
      %ul
        - @friend.errors.full_messages.each do |msg|
          %li= msg
  .field
    = f.label :name
    = f.text_field :name
  .field
    = f.label :avatar
    = f.file_field :avatar
  .actions
    = f.submit 'Make a friend'
    = link_to 'Nevermind', friends_path, class: 'button'

Add avatar upload form from Heroku tutorial
Add avatar upload form from Heroku tutorial
