Skip to content

Commit 3314200

Browse files
authored
Improve readability and fix typos.
1 parent a445f56 commit 3314200

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ This method requires HTTP status code and an optional parameter explaining the e
6060
## Configuration
6161
Currently you can only configure which options are required to be passed through the `respond_with` method. These required options are categorized by the controller's actions. Bellow you can find an example:
6262

63+
# config/initializers/json_api_responders.rb
6364
JsonApiResponders.configure do |config|
6465
config.required_options = {
6566
index: [:each_serializer],
6667
create: [:serializer]
6768
}
6869
end
69-
...
70+
71+
# app/controllers/v1/users_controller.rb
7072
def create
7173
user = User.create(...)
7274
respond_with user, serializer: UserSerializer
@@ -90,13 +92,15 @@ If `:serializer` was left out of the above `respond_with` method you would see t
9092
render json: resource, status: 201
9193
else
9294
render error: errors, status: 409
95+
end
9396

9497
### update
9598

9699
if resource.valid?
97100
render json: resource, status: 200
98101
else
99102
render error: errors, status: 409
103+
end
100104

101105
### destroy
102106

0 commit comments

Comments
 (0)