Skip to content

Instantly share code, notes, and snippets.

@diegoy
Created June 13, 2017 01:07
Show Gist options
  • Save diegoy/3b630840e39b3a417450f97bff3b96b2 to your computer and use it in GitHub Desktop.
Save diegoy/3b630840e39b3a417450f97bff3b96b2 to your computer and use it in GitHub Desktop.
class MessagesController < BaseController
def create
conversation = Conversation.find(params[:conversation_id])
message = conversation.messages.create(params)
if message.valid?
Mailer.send_message(destination, message).deliver_later
#render success
else
#render error
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment