Skip to content

Commit d0f4852

Browse files
authored
Merge pull request #806 from iosadchii/update-readme
Update method name in README
2 parents 4bf8632 + 11ee266 commit d0f4852

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,17 +1416,17 @@ Pass a block, refer to controller class methods, or both. Note that methods must
14161416

14171417
#### Action Callbacks
14181418

1419-
##### ensure_correct_media_type
1419+
##### verify_content_type_header
14201420

1421-
By default, when controllers extend functionalities from `jsonapi-resources`, the `ActsAsResourceController#ensure_correct_media_type`
1421+
By default, when controllers extend functionalities from `jsonapi-resources`, the `ActsAsResourceController#verify_content_type_header`
14221422
method will be triggered before `create`, `update`, `create_relationship` and `update_relationship` actions. This method is reponsible
14231423
for checking if client's request corresponds to the correct media type required by [JSON API](http://jsonapi.org/format/#content-negotiation-clients): `application/vnd.api+json`.
14241424
14251425
In case you need to check the media type for custom actions, just make sure to call the method in your controller's `before_action`:
14261426

14271427
```ruby
14281428
class UsersController < JSONAPI::ResourceController
1429-
before_action :ensure_correct_media_type, only: [:auth]
1429+
before_action :verify_content_type_header, only: [:auth]
14301430
14311431
def auth
14321432
# some crazy auth code goes here

0 commit comments

Comments
 (0)