From f8c81f679d1668f1def5290c5fc906f9606508a4 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 10 Nov 2014 23:46:38 +0100 Subject: [PATCH] now actually adding the asked question to the inbox --- app/controllers/ajax/question_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/ajax/question_controller.rb b/app/controllers/ajax/question_controller.rb index 58c05b1e..6269e945 100644 --- a/app/controllers/ajax/question_controller.rb +++ b/app/controllers/ajax/question_controller.rb @@ -4,10 +4,10 @@ class Ajax::QuestionController < ApplicationController params.require :anonymousQuestion params.require :rcpt + question = Question.create!(content: params[:question], + author_is_anonymous: params[:anonymousQuestion]) - - Question.create(content: params[:question], - author_is_anonymous: params[:anonymousQuestion]) + Inbox.create!(user_id: params[:rcpt], question_id: question.id, new: true) @status = :okay @message = "Question asked successfully."