now actually adding the asked question to the inbox
This commit is contained in:
parent
17db50623a
commit
f8c81f679d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue