<h1>Editar projeto</h1>

<%= simple_form_for(@project, :url => { :action => :update }) do |f| %>
  <div class="form-inputs">
    <%= f.simple_fields_for :book do |b| %>
      <%= b.input :template, :collection => LATEX_TEMPLATES %>
      <%= b.input :cover, :as => :file %>
    <% end %>
  </div>

  <div class="form-actions">
    <%= f.button :submit, :class => 'btn btn-primary' %>
  </div>
<% end %>

<h1>Editar projeto</h1>

<%= simple_form_for(@project, :url => { :action => :update }) do |f| %>
  <div class="form-inputs">
    <%= f.simple_fields_for :book do |b| %>
      <%= b.input :template, :collection => LATEX_TEMPLATES %>

      <label for="project_book_attributes_cover">Capa</label>
      <div class="fileupload <%= @project.book.cover.present? ? 'fileupload-exists' : 'fileupload-new' %>" data-provides="fileupload">
        <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
          <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&text=sem+imagem" />
        </div>
        <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;">
          <%= image_tag(@project.book.cover.url) if @project.book.cover.present? %>
        </div>
        <div>
          <span class="btn btn-file"><span class="fileupload-new">Selecionar imagem</span><span class="fileupload-exists">Alterar</span>
            <%= b.input_field :cover, :as => :file %>
          </span>
          <a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remover</a>
        </div>
      </div>
    <% end %>
  </div>

  <div class="form-actions">
    <%= f.button :submit, :class => 'btn btn-primary' %>
  </div>
<% end %>

Add file upload field to project edit form
Add file upload field to project edit form
