<h1>Editing post</h1>

<%= error_messages_for :post %>

<% form_for(:post, :url => 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', post_path(@post.user, @post) %> |
<%= link_to 'Back', posts_path(@post.user) %>