X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e731dd71a77ad4ad1e9db22535e89444bb98e5d9..8c326a6c1fcea02c2937579524c30b5c77c4d8eb:/app/controllers/api/ways_controller.rb?ds=sidebyside diff --git a/app/controllers/api/ways_controller.rb b/app/controllers/api/ways_controller.rb index 9af087d83..3b58f208b 100644 --- a/app/controllers/api/ways_controller.rb +++ b/app/controllers/api/ways_controller.rb @@ -11,6 +11,8 @@ module Api before_action :check_api_readable, :except => [:create, :update, :delete] around_action :api_call_handle_error, :api_call_timeout + before_action :set_request_formats, :except => [:create, :update, :delete] + def create assert_method :put @@ -28,7 +30,10 @@ module Api if @way.visible # Render the result - render :formats => [:xml] + respond_to do |format| + format.xml + format.json + end else head :gone end @@ -75,7 +80,10 @@ module Api end # Render the result - render :formats => [:xml] + respond_to do |format| + format.xml + format.json + end else head :gone end @@ -93,7 +101,10 @@ module Api @ways = Way.find(ids) # Render the result - render :formats => [:xml] + respond_to do |format| + format.xml + format.json + end end ## @@ -106,7 +117,10 @@ module Api @ways = Way.where(:id => wayids, :visible => true) # Render the result - render :formats => [:xml] + respond_to do |format| + format.xml + format.json + end end end end