diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-10-06 12:09:08 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-10-06 12:09:08 +0200 |
commit | f72a88dcb8fd18778445b4e6678cdfdee7feda28 (patch) | |
tree | 84c65896bf2a049db5b48f4dabd2b6e2b6a3b646 /application.rb | |
parent | 18e1ec84378d711b36b1a77b29baa9b5ef664faa (diff) |
add text/html support, remove delete disabling, add new line to uri-list returns
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/application.rb b/application.rb index 5e875c1..2cdbe32 100644 --- a/application.rb +++ b/application.rb @@ -1,5 +1,5 @@ require 'rubygems' -gem 'opentox-ruby-api-wrapper', '= 1.6.2' +gem 'opentox-ruby-api-wrapper', '= 1.6.2.1' [ 'sinatra', 'sinatra/url_for', 'opentox-ruby-api-wrapper' ].each do |lib| require lib end @@ -13,8 +13,14 @@ require "example.rb" get '/examples/?' do LOGGER.info "list examples" - content_type "text/plain" - Example.transform_example + + if request.env['HTTP_ACCEPT'] =~ /text\/html/ + content_type "text/html" + OpenTox.text_to_html Example.transform_example + else + content_type "text/plain" + Example.transform_example + end end get '/prepare_examples/?' do |