now actually adding the asked question to the inbox

This commit is contained in:
nilsding 2014-11-10 23:46:38 +01:00
parent 17db50623a
commit f8c81f679d
1 changed files with 3 additions and 3 deletions

View File

@ -4,11 +4,11 @@ class Ajax::QuestionController < ApplicationController
params.require :anonymousQuestion
params.require :rcpt
Question.create(content: params[:question],
question = 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."
@success = true