Class: Api::V1::PingController
- Inherits:
-
ApiController
- Object
- ApiController
- Api::V1::PingController
- Defined in:
- app/controllers/api/v1/ping_controller.rb
Instance Method Summary collapse
Instance Method Details
#asset_exists?(path) ⇒ Boolean (protected)
17 18 19 20 21 22 23 24 |
# File 'app/controllers/api/v1/ping_controller.rb', line 17 def asset_exists?(path) begin pathname = Rails.application.assets.resolve(path) return !!pathname # double-bang turns String into boolean rescue Sprockets::FileNotFound return false end end |
#ping ⇒ Object
3 4 5 |
# File 'app/controllers/api/v1/ping_controller.rb', line 3 def ping render json: '{"pong": true}', status: :ok end |
#pingz ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/api/v1/ping_controller.rb', line 7 def pingz if asset_exists?('zzzz.css') render json: '{"pong": true}', status: :ok else head :service_unavailable end end |