From: Tom Hughes Date: Mon, 5 May 2008 23:01:05 +0000 (+0000) Subject: Fix replying to diary comments, and tidy a few things up. X-Git-Tag: live~8310 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a47fcb08579b06dcd615af92d9e530033d8673dc Fix replying to diary comments, and tidy a few things up. --- diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index 0fec8aab1..e79fe7461 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -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 diff --git a/app/views/message/new.rhtml b/app/views/message/new.rhtml index 723cb1f10..214df8d31 100644 --- a/app/views/message/new.rhtml +++ b/app/views/message/new.rhtml @@ -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 %>

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

@@ -10,11 +10,11 @@ <%= 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| %> - +
Subject<%= text_field_tag 'message[title]', title, :size => 60, :value => @title %><%= f.text_field :title, :size => 60, :value => @title %>
Body