-<% user_id = params[:user_id] || @user_id %>
-<% display_name = User.find_by_id(user_id).display_name %>
-
-<h2>Send a new message to <%= h(display_name) %></h2>
+<h2>Send a new message to <%= h(@to_user.display_name) %></h2>
<% if params[:display_name] %>
<p>Writing a new message to <%= h(params[:display_name]) %></p>
<%= error_messages_for 'message' %>
-<% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %>
+<% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %>
<table>
<tr valign="top">
<th>Subject</th>