Class: RackSpellChecker::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_spellchecker/application.rb

Overview

Rack Application that processes Spell Check requests from TinyMCE

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
# File 'lib/rack_spellchecker/application.rb', line 6

def call(env)
  req = JSON.parse(env["rack.input"].read)
  results = RackSpellChecker::RequestHandler.process(req) 
  [200, {"Content-Type" => "text/javascript"}, [results.to_json]]
end