app/controllers/catalog_controller.rb
# Add CORS headers for JSON API responses
Add CORS headers for JSON API responses
Add CORS headers for JSON API responses
def json_cors_headers
    if params[:format] == "json" || request.format == "application/json"
      response.headers["Access-Control-Allow-Origin"] = "*"
    end
  end
def json_cors_headers if params [ :format ] == "json" || request . format == "application/json" response . headers [ "Access-Control-Allow-Origin" ] = "*" end end
Add CORS headers for JSON API responses
Add CORS headers for JSON API responses