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

Basic Jsonapi Renderer registration #1547

Merged
merged 1 commit into from
Mar 29, 2016
Merged

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Feb 29, 2016

To be used by #1532 (comment) to generate docs to describe
registering a json api renderer in Rails

Usage:

ActiveSupport.on_load(:action_controller) do
  require 'active_model_serializers/register_jsonapi_renderer'
end

and then in controllers, use render jsonapi: model rather than render json: model, adapter: :json_api

@bf4
Copy link
Member Author

bf4 commented Feb 29, 2016

cc @dgeb @lgebhardt @joaomdmoura

#
# In a controller action, we can:
# respond_to do |format|
# format.jsonapi { render jsonapi: model }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea. Also, great comments!

@NullVoxPopuli
Copy link
Contributor

Can your usage comment be included in the comments for the register_jsonapi_renderer? Would be nice for reference

@bf4
Copy link
Member Author

bf4 commented Mar 8, 2016

Also needs trst

B mobile phone

On Mar 8, 2016, at 8:42 AM, L. Preston Sego III notifications@github.com wrote:

Can your usage comment be included in the comments for the register_jsonapi_renderer?


Reply to this email directly or view it on GitHub.

@bf4 bf4 force-pushed the jsonapi_renderer branch from 2abeaa9 to d364c4f Compare March 29, 2016 03:04
@bf4 bf4 changed the title Spike Jsonapi Renderer registration Basic Jsonapi Renderer registration Mar 29, 2016
@bf4 bf4 merged commit c7b2916 into rails-api:master Mar 29, 2016
@bf4 bf4 deleted the jsonapi_renderer branch March 29, 2016 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants