Class: Paltrow::Rendering::Rails::JSON
- Inherits:
-
Object
- Object
- Paltrow::Rendering::Rails::JSON
- Defined in:
- lib/paltrow/rendering/rails/json.rb
Instance Method Summary collapse
Instance Method Details
#call(handler:, page:) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/paltrow/rendering/rails/json.rb', line 5 def call handler:, page: page .to_monad .fmap { |page| handler.render(json: page.locals) } .or { |page| handler.render(json: {error: page.}, status: :unprocessable_entity) } end |