after sending a message, redirect_to the inbox

This commit is contained in:
joshua stein 2013-02-11 21:56:00 -06:00
parent 04363c54df
commit d971e2072f

View file

@ -35,16 +35,16 @@ class MessagesController < ApplicationController
@new_message = Message.new(params[:message]) @new_message = Message.new(params[:message])
@new_message.author_user_id = @user.id @new_message.author_user_id = @user.id
@direction = :out
@messages = @user.undeleted_received_messages @messages = @user.undeleted_received_messages
if @new_message.save if @new_message.save
flash.now[:success] = "Your message has been sent to " << flash[:success] = "Your message has been sent to " <<
@new_message.recipient.username.to_s << "." @new_message.recipient.username.to_s << "."
return redirect_to "/messages"
@new_message = Message.new else
render :action => "index"
end end
render :action => "index"
end end
def show def show