From 9823642115ef52f0a21b9466cef412098a124f3d Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 24 Apr 2014 19:03:36 -0400 Subject: Mailboxer progress without generate changes. --- app/controllers/pms_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/controllers/pms_controller.rb') diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index 1d6540d..9dbe760 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -24,11 +24,11 @@ class PmsController < ApplicationController def create @pm = Pm.new(pm_params) @pm.author = current_user - require 'pp' - pp @pm.message + #require 'pp' + #pp @pm.message @pm.recipient = User.find_by_user_name(pm_params['recipient_id']) - @pm.author.send_message(@pm.recipient, @pm.message, 'Default') + @pm.conversation = @pm.author.send_message(@pm.recipient, @pm.message, @pm.subject).conversation respond_to do |format| if @pm.save @@ -41,6 +41,10 @@ class PmsController < ApplicationController end end + #def reply + # current_user.reply_to_conversation(conversation, message) + #end + # PATCH/PUT /pms/1 # PATCH/PUT /pms/1.json def update -- cgit v1.2.3-2-g168b From 67d95e5b92e3d19765c7ccaf5460737ffe2173f4 Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 24 Apr 2014 19:07:40 -0400 Subject: run ./generate.sh --- app/controllers/pms_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/pms_controller.rb') diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index b62a6ef..11f51c8 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -69,6 +69,6 @@ class PmsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def pm_params - params.require(:pm).permit(:author_id, :recipient_id, :message) + params.require(:pm).permit(:author_id, :recipient_id, :message, :subject, :conversation_id) end end -- cgit v1.2.3-2-g168b