<h1>Editing post</h1>

<%= error_messages_for :post %>

<% form_for(:post, :url => user_post_path(@post.user, @post), :html => { :method => :put }) do |f| %>
  <p>
    <b>User</b><br />
    <%= f.text_field :user_id %>
  </p>

  <p>
    <b>Title</b><br />
    <%= f.text_field :title %>
  </p>

  <p>
    <b>Body</b><br />
    <%= f.text_area :body %>
  </p>

  <p>
    <%= submit_tag "Update" %>
  </p>
<% end %>

<%= link_to 'Show', user_post_path(@post.user, @post) %> |
<%= link_to 'Back', user_posts_path(@post.user) %>
