<div class="container">
  <h4>Add a photo</h4>

  <%= form_for @photo, url: {action: "create"}, html: {class: "nifty_form"} do |form| %>

    <div class="row">
      <div class= "btn blue darken-2">
        <%= form.label :file %>
        <%= form.file_field :image %>
      </div>
    </div>

    <div class="row">
      <div class="input-field col s6">
        <%= form.label :caption %>
        <%= form.text_field :caption, size: 50, class: "validate" %>
      </div>
    </div>

    <button class="btn btn-success" type="commit" name="action">
      Submit
    </button>

    <%= link_to('Cancel', photos_path) %>

  <% end %>
</div>