X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a894e75a1d898804ea6bc41c73384135ed83e87e..db66d47e42bc267670ef00b3b2611b4b53cb40e9:/app/views/message/new.rhtml diff --git a/app/views/message/new.rhtml b/app/views/message/new.rhtml index 44ef84dfc..d7bb18f8e 100644 --- a/app/views/message/new.rhtml +++ b/app/views/message/new.rhtml @@ -1,27 +1,28 @@ -<% display_name = (User.find_by_id(params[:user_id])).display_name %> +<% user_id = params[:user_id] || @user_id %> +<% display_name = User.find_by_id(user_id).display_name %> -

Send a new message to <%= display_name %>

+

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

<% if params[:display_name] %> -

Writing a new message to <%= 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 do |f| %> +<% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %> - + - + - +
Subject<%= f.text_field :title, :size => 60 %><%= f.text_field :title, :size => 60, :value => @title %>
Body<%= f.text_area :body, :cols => 80 %><%= f.text_area :body, :cols => 80, :value => @body %>
<%= f.submit_tag 'Send' %><%= submit_tag 'Send' %>
<% end %>