Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (25 sloc) 747 Bytes
<% editing = @event["path"].include?("edit") %>
<% action = editing ? "/posts/#{post.id}" : "/posts" %>
<%= form_tag(action, multipart: true) do %>
<% if post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(post.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% post.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= label_tag :title %>
<%= text_field_tag "post[title]", post.title %>
</div>
<div class="field">
<%= label_tag :photo %>
<%= file_field_tag "post[photo]" %>
</div>
<div class="actions">
<%= submit_tag("Submit") %>
</div>
<% end %>