<%= form_for(@post) do |f| %> <% if @post.errors.any? %>

<%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:

<% end %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.label :body %>
<%= f.text_area :body %>
<%= f.label :published %>
<%= f.check_box :published %>
<%= f.label :user_id %>
<%= f.collection_select :user_id, User.all, :id, :name %>
<%= f.submit %>
<% end %>