Created
August 6, 2014 07:41
-
-
Save kiote/4415d620836de5ad62f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@question = Question.new(params[:question]) | |
// @conversation = Conversation.create | |
if @question.save | |
@message = current_user.send_message(@question, @question.question, "You have a question from #{@question.sender_id}") | |
//messages.new(:subject => "You have a question from #{@question.sender_id}", | |
// :notification_id => @question.sender_id, | |
// :receiver_id => @question.recipient_id, | |
// :conversation_id => @conversation.id, | |
// :body => @question.question) | |
@question.message = @message | |
@question.save | |
redirect_to :back, notice: 'Your question was saved successfully. Thanks!' | |
else | |
render :new, alert: 'Sorry. There was a problem saving your question.' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment