diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 1bf4957..b4e8b99 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -4,6 +4,10 @@ class MessagesController < ApplicationController def index @new_message = Message.new + + if params[:to] + @new_message.recipient_username = params[:to] + end end def create diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a8f8d4a..95e4978 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,7 +1,10 @@
-
- <%= @showing_user.username %> -
+
+ <%= @showing_user.username %> + <% if @user %> + (Send a Message) + <% end %> +