module-and-template-store/app/views/templates/_form.html.erb

38 lines
867 B
Plaintext

<%= form_for(@template, :html => {:multipart => true}) do |f| %>
<% if @template.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@template.errors.count, "error") %> prohibited this template from being saved:</h2>
<ul>
<% @template.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :title %><br>
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :author %><br>
<%= f.text_field :author %>
</div>
<p>
<label>Preview</label>
<%= f.file_field :preview %>
<%= f.hidden_field :preview_cache %>
</p>
<p>
<label>Template</label>
<%= f.file_field :template %>
<%= f.hidden_field :template_cache %>
</p>
<div class="actions">
<%= f.submit %>
</div>
<% end %>