Class: HousingMisc::CacheController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- HousingMisc::CacheController
- Defined in:
- app/controllers/housing_misc/cache_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods inherited from ActionController::Base
Instance Method Details
#show ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/controllers/housing_misc/cache_controller.rb', line 3 def show render json: {data: {}, message: "cache key misisng", status: 404}, status: 404 if params['cache_key'].blank? data = Rails.cache.read(params['cache_key']) , = ["success", "not found"] data, , status = data.present? ? [JSON.parse(data), , 200] : [{}, , 404] render json: {message: , status: status, data: data }, status: status end |