Files
sure/app/controllers/pwa_controller.rb
T

17 lines
653 B
Ruby

class PwaController < ApplicationController
skip_authentication
skip_forgery_protection
def manifest
# Force JSON format to avoid MissingTemplate errors when browsers request /manifest
# with HTML Accept headers (Safari Mobile does this for PWA manifest discovery)
render "pwa/manifest", formats: [ :json ], content_type: "application/manifest+json"
end
def service_worker
# Explicitly render JS template to avoid format negotiation issues
render "pwa/service-worker", formats: [ :js ], content_type: "application/javascript"
end
# Renders app/views/pwa/service-worker.js with content type application/javascript
end