From fb953006a1a8fe2949f376e167dda963dfd784bd Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Fri, 28 Jun 2019 21:56:42 +0200 Subject: [PATCH] Replace respond_to with render xml format --- app/controllers/api/map_controller.rb | 4 +--- app/controllers/api/nodes_controller.rb | 8 ++------ app/controllers/api/old_controller.rb | 8 ++------ app/controllers/api/relations_controller.rb | 16 ++++------------ app/controllers/api/ways_controller.rb | 16 ++++------------ 5 files changed, 13 insertions(+), 39 deletions(-) diff --git a/app/controllers/api/map_controller.rb b/app/controllers/api/map_controller.rb index e8a27042d..c783759bc 100644 --- a/app/controllers/api/map_controller.rb +++ b/app/controllers/api/map_controller.rb @@ -90,9 +90,7 @@ module Api response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\"" # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end end end diff --git a/app/controllers/api/nodes_controller.rb b/app/controllers/api/nodes_controller.rb index dafb19ebd..8a8068e7e 100644 --- a/app/controllers/api/nodes_controller.rb +++ b/app/controllers/api/nodes_controller.rb @@ -32,9 +32,7 @@ module Api if @node.visible # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] else head :gone end @@ -75,9 +73,7 @@ module Api @nodes = Node.find(ids) # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end end end diff --git a/app/controllers/api/old_controller.rb b/app/controllers/api/old_controller.rb index 49fdcf1a3..984534b06 100644 --- a/app/controllers/api/old_controller.rb +++ b/app/controllers/api/old_controller.rb @@ -30,9 +30,7 @@ module Api end # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end def version @@ -43,9 +41,7 @@ module Api response.last_modified = @old_element.timestamp # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end end diff --git a/app/controllers/api/relations_controller.rb b/app/controllers/api/relations_controller.rb index 2f2cb8503..fbc958098 100644 --- a/app/controllers/api/relations_controller.rb +++ b/app/controllers/api/relations_controller.rb @@ -26,9 +26,7 @@ module Api response.last_modified = @relation.timestamp if @relation.visible # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] else head :gone end @@ -119,9 +117,7 @@ module Api @relations << relation # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] else head :gone end @@ -137,9 +133,7 @@ module Api @relations = Relation.find(ids) # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end def relations_for_way @@ -166,9 +160,7 @@ module Api end # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end end end diff --git a/app/controllers/api/ways_controller.rb b/app/controllers/api/ways_controller.rb index 0871384a7..e5841e2ad 100644 --- a/app/controllers/api/ways_controller.rb +++ b/app/controllers/api/ways_controller.rb @@ -28,9 +28,7 @@ module Api if @way.visible # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] else head :gone end @@ -77,9 +75,7 @@ module Api end # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] else head :gone end @@ -97,9 +93,7 @@ module Api @ways = Way.find(ids) # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end ## @@ -112,9 +106,7 @@ module Api @ways = Way.where(:id => wayids, :visible => true) # Render the result - respond_to do |format| - format.xml - end + render formats: [:xml] end end end -- 2.43.2