Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails controller integration #368

Open
okuramasafumi opened this issue May 17, 2024 · 0 comments · May be fixed by #370
Open

Rails controller integration #368

okuramasafumi opened this issue May 17, 2024 · 0 comments · May be fixed by #370
Assignees
Labels
enhancement New feature or request

Comments

@okuramasafumi
Copy link
Owner

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:

class FoosController < ApplicationController
  def show
    foo = Foo.find(params[:id])
    render_serialized_json foo
  end
end

Describe alternatives you've considered

class FoosController < ApplicationController
  def show
    foo = Foo.find(params[:id])
    render json: serialize(foo)
  end
end

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.

@okuramasafumi okuramasafumi added the enhancement New feature or request label May 17, 2024
@okuramasafumi okuramasafumi self-assigned this May 17, 2024
@okuramasafumi okuramasafumi linked a pull request Jun 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant