Skip to content

Instantly share code, notes, and snippets.

@hidenowt
Created March 18, 2009 20:12
Show Gist options
  • Save hidenowt/81367 to your computer and use it in GitHub Desktop.
Save hidenowt/81367 to your computer and use it in GitHub Desktop.
<!-- partial -->
<%= f.error_messages %>
<p>
<%= f.label :ordinary_name %><br />
<%= f.text_field :ordinary_name %>
</p>
<p>
<%= f.label :scientific_name %><br />
<%= f.text_field :scientific_name %>
</p>
<p>
<%= f.label :release %><br />
<%= f.text_area :release %>
</p>
<p>
<%= f.label :photo %><br />
<%= f.file_field :photo %>
<p>
<% unless bisk.new_record? || !bisk.photo? %>
<p>
<%= f.label(:delete_photo, 'Delete photo') %>
<%= image_tag(@bisk.photo.url, :align => "absmiddle") %>
<%= f.check_box(:delete_photo) %>
</p>
<% end %>
<p>
<%= f.label :category %><br />
<%= f.select :category_id, @categories, :prompt => "Categoria..." %>
</p>
<!-- partial -->
<!-- new -->
<% @nome_pagina = 'Adicionar Peixe' %>
<% form_for(@bisk, :html => { :multipart => true }) do |f| %>
<%= render :partial => "bisk", :locals => { :f => f } %>
<%= f.submit "Criar Peixe" %>
<% end %>
<%= link_to 'Retornar', bisks_path %>
<!-- new -->
<!-- edit -->
<% @nome_pagina = 'Editar Peixe' %>
<% form_for(@bisk, :html => { :multipart => true }) do |f| %>
<%= render :partial => "bisk", :locals => { :f => f } %>
<%= f.submit "Atualizar Peixe" %>
<% end %>
<%= link_to 'Exibir', @bisk %> |
<%= link_to 'Retornar', bisks_path %>
<!-- edit -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment