]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/message/new.rhtml
Merge vendor tree from api06 branch.
[rails.git] / app / views / message / new.rhtml
index 44ef84dfcb183c7195bd1ffd0bfe3170fa695766..17f3588bb47b4b3a6668a0c06111066eea6674b5 100644 (file)
@@ -1,27 +1,25 @@
-<% display_name = (User.find_by_id(params[:user_id])).display_name %>
-
-<h2>Send a new message to <%= 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 <%= params[:display_name] %></p>  
+<p>Writing a new message to <%= h(params[:display_name]) %></p>  
 <p>TODO: drop down box of your friends</p>
 <%end%>
 
 <%= error_messages_for 'message' %>
 
-<% form_for :message do |f| %>
+<% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %>
   <table>
     <tr valign="top">
       <th>Subject</th>
-      <td><%= f.text_field :title, :size => 60 %></td>
+      <td><%= f.text_field :title, :size => 60, :value => @title %></td>
     </tr>
     <tr valign="top">
       <th>Body</th>
-      <td><%= f.text_area :body, :cols => 80 %></td>
+      <td><%= f.text_area :body, :cols => 80, :value => @body %></td>
     </tr>
     <tr>
       <th></th>
-      <td><%= f.submit_tag 'Send' %></td>
+      <td><%= submit_tag 'Send' %></td>
     </tr>
   </table>
 <% end %>