lib/monocle/server.rb in monocle-0.1.0 vs lib/monocle/server.rb in monocle-0.1.1
- old
+ new
@@ -1,20 +1,15 @@
require "sinatra/base"
module Monocle
class Server < Sinatra::Base
- post "/:type/:id" do
+ post "/:type/:id(.:format)" do
begin
params[:type].classify.constantize.find(params[:id]).view!
ActiveRecord::Base.clear_active_connections!
"o_0 +1"
rescue ActiveRecord::RecordNotFound
"o_0"
end
- end
-
- get "/:type/:id" do
- content_type("image/gif")
- File.open(File.join(File.dirname(__FILE__), "..", "transparent.gif"))
end
end
end