Skip to content

Instantly share code, notes, and snippets.

@rbin
Created December 20, 2013 15:54
Show Gist options
  • Save rbin/8056725 to your computer and use it in GitHub Desktop.
Save rbin/8056725 to your computer and use it in GitHub Desktop.
def message
if params['subject'].to_s.strip.downcase == "joke"
Message.create!({ message_type: "joke", from: params['from'], body: params['text'] })
render :json => { "message" => "RIGHT" }, :status => 200
else
Message.create!({ message_type: "xmas_message", from: params['from'], body: params['text'] })
render :json => { "message" => "RIGHT" }, :status => 200
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment