https://github.com/sixarm/sixarm_ruby_action_dispatch_response_json
SixArm.com » Ruby » ActionDispatch Response#json method
https://github.com/sixarm/sixarm_ruby_action_dispatch_response_json
actiondispatch gem json rails ruby
Last synced: 2 months ago
JSON representation
SixArm.com » Ruby » ActionDispatch Response#json method
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_action_dispatch_response_json
- Owner: SixArm
- License: other
- Created: 2015-02-12T11:36:02.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T09:17:57.000Z (about 1 year ago)
- Last Synced: 2025-08-23T02:50:35.574Z (11 months ago)
- Topics: actiondispatch, gem, json, rails, ruby
- Language: Ruby
- Size: 254 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
ActionPack Response#json method
[](http://badge.fury.io/rb/sixarm_ruby_action_dispatch_response_json)
[](https://travis-ci.org/SixArm/sixarm_ruby_action_dispatch_response_json)
[](https://codeclimate.com/github/SixArm/sixarm_ruby_action_dispatch_response_json/maintainability)
* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).
## Introduction
This gem extends ActionPack Response with JSON API methods.
You can replace this:
JSON.parse(response.body)
With this:
response.json
You can replace these:
response.json["data"]
response.json["errors"]
response.json["linked"]
response.json["links"]
response.json["meta"]
With these:
response.data
response.errors
response.linked
response.links
response.meta
For docs go to
Want to help? We're happy to get pull requests.
## Install
### Gem
To install this gem in your shell or terminal:
gem install sixarm_ruby_action_dispatch_response_json
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_action_dispatch_response_json'
### Require
To require the gem in your code:
require 'sixarm_ruby_action_dispatch_response_json'