From 5f6cb744a31538674b42c2a190df5209c670393b Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 20 Feb 2013 01:23:08 -0500 Subject: [PATCH] implement xml response for legacy post create action --- app/controllers/legacy_controller.rb | 1 - app/views/legacy/create_post.xml.erb | 4 ++++ config/routes.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 app/views/legacy/create_post.xml.erb diff --git a/app/controllers/legacy_controller.rb b/app/controllers/legacy_controller.rb index eed89c6b8..f49f401db 100644 --- a/app/controllers/legacy_controller.rb +++ b/app/controllers/legacy_controller.rb @@ -9,7 +9,6 @@ class LegacyController < ApplicationController def create_post @upload = Upload.create(params[:post].merge(:server => Socket.gethostname)) @upload.delay.process! - render :nothing => true end def users diff --git a/app/views/legacy/create_post.xml.erb b/app/views/legacy/create_post.xml.erb new file mode 100644 index 000000000..b3a1be71b --- /dev/null +++ b/app/views/legacy/create_post.xml.erb @@ -0,0 +1,4 @@ + + 0 + http://<%= Danbooru.config.hostname %>/uploads/<%= @upload.id %> + diff --git a/config/routes.rb b/config/routes.rb index 17cfb569f..6e86a1aea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -223,7 +223,7 @@ Danbooru::Application.routes.draw do match "/post/index.xml", :controller => "legacy", :action => "posts", :format => "xml" match "/post/index.json", :controller => "legacy", :action => "posts", :format => "json" - match "/post/create.xml", :controller => "legacy", :action => "create_post" + match "/post/create.xml", :controller => "legacy", :action => "create_post", :format => "xml" match "/post/piclens", :controller => "legacy", :action => "unavailable" match "/post/index" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"} match "/post" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"}