<% user_id = params[:user_id] || @user_id %> <% display_name = User.find_by_id(user_id).display_name %>

Send a new message to <%= h(display_name) %>

<% if params[:display_name] %>

Writing a new message to <%= h(params[:display_name]) %>

TODO: drop down box of your friends

<%end%> <%= error_messages_for 'message' %> <% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %>
Subject <%= f.text_field :title, :size => 60, :value => @title %>
Body <%= f.text_area :body, :cols => 80, :value => @body %>
<%= submit_tag 'Send' %>
<% end %>
<%= link_to 'Back to inbox', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>