]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/relations_controller.rb
Replace respond_to with render xml format
[rails.git] / app / controllers / api / relations_controller.rb
index 41f4e325afa8c21db018946b257775b312755d12..fbc9580982bbd4345d5dc6828f5b7ed9b7c60cf2 100644 (file)
@@ -22,15 +22,11 @@ module Api
     end
 
     def show
-      relation = Relation.find(params[:id])
-      response.last_modified = relation.timestamp
-      if relation.visible
-        @relation = relation
-
+      @relation = Relation.find(params[:id])
+      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
@@ -121,9 +117,7 @@ module Api
         @relations << relation
 
         # Render the result
-        respond_to do |format|
-          format.xml
-        end
+        render formats: [:xml]
       else
         head :gone
       end
@@ -139,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
@@ -168,9 +160,7 @@ module Api
       end
 
       # Render the result
-      respond_to do |format|
-        format.xml
-      end
+      render formats: [:xml]
     end
   end
 end