Created
August 17, 2011 03:05
-
-
Save jdkealy/1150730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAIN FORM | |
<%= form_for(@project) do |f| %> | |
<% if @project.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@project.errors.count, "error") %> prohibited this project from being saved:</h2> | |
<ul> | |
<% @project.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :diagram %> | |
<%= f.file_field :diagram %> | |
</div> | |
<div class="field"> | |
<% if(@project.photo) %> | |
<%= image_tag @project.photo %> | |
<br /> | |
<% end %> | |
<%= f.label :photo %> | |
<%= f.file_field :photo %> | |
</div> | |
<div class="field"> | |
<%= f.fields_for :galleries do |builder| %> | |
<%= builder %> | |
<%= render "gallery_fields", :f => builder %> | |
<% end %> | |
<p><%= link_to_add_fields "Add Image", f, :galleries %></p> | |
</div> | |
<div class="actions"> | |
<%= f.submit %> | |
</div> | |
<% end %> | |
PARTIAL | |
<div class="field"> | |
<%#= link_to 'Destroy', project, confirm: 'Are you sure?', method: :delete %> | |
<%= #nothing @gallery %> | |
<%= #error gallery %> | |
<%= #f %> | |
<%= params %> | |
<%= f.label :photo %> | |
<%= f.file_field :photo %> | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment