]> git.openstreetmap.org Git - rails.git/commitdiff
Fix replying to diary comments, and tidy a few things up.
authorTom Hughes <tom@compton.nu>
Mon, 5 May 2008 23:01:05 +0000 (23:01 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 5 May 2008 23:01:05 +0000 (23:01 +0000)
app/controllers/message_controller.rb
app/views/message/new.rhtml

index 0fec8aab1cb00225d67ef62df671fe44e52f1f69..e79fe7461c72a8d42efd4541a873a1dcfe84e7d4 100644 (file)
@@ -17,6 +17,8 @@ class MessageController < ApplicationController
         Notifier::deliver_message_notification(@message)
         redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
       end
+    else
+      @title = params[:title]
     end
   end
 
index 723cb1f10277bcffcac5c8dc9b725f54c06b2411..214df8d31fd8f1de8130d335559d12590b961277 100644 (file)
@@ -1,5 +1,5 @@
-<% display_name = User.find_by_id(params[:user_id] || @user_id).display_name %>
-<% title = params[:message] ? params[:message][:title] : params[:title] %>
+<% 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>
 
 
 <%= error_messages_for 'message' %>
 
-<% form_for :message, :url => {:user_id => params[:user_id] || @user_id,  :action => "new" } do |f| %>
+<% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %>
   <table>
     <tr valign="top">
       <th>Subject</th>
-      <td><%= text_field_tag 'message[title]', title, :size => 60, :value => @title %></td>
+      <td><%= f.text_field :title, :size => 60, :value => @title %></td>
     </tr>
     <tr valign="top">
       <th>Body</th>