Closed okuramasafumi closed 3 months ago
In Rails controller, we still need to integrate manually with something like render json: FooResource.new(foo).
render json: FooResource.new(foo)
For example:
class FoosController < ApplicationController def show foo = Foo.find(params[:id]) render_serialized_json foo end end
class FoosController < ApplicationController def show foo = Foo.find(params[:id]) render json: serialize(foo) end end
In a book, Layered Design for Ruby on Rails Applications, the author (@palkan) uses a custom integration with Rails, and I see it convenient.
Is your feature request related to a problem? Please describe.
In Rails controller, we still need to integrate manually with something like
render json: FooResource.new(foo)
.Describe the solution you'd like
For example:
Describe alternatives you've considered
Additional context
In a book, Layered Design for Ruby on Rails Applications, the author (@palkan) uses a custom integration with Rails, and I see it convenient.