Skip to content

Commit dd28d69

Browse files
committed
Document configuration options
1 parent 9420e6c commit dd28d69

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,42 @@ end
11741174

11751175
You would specify this in `JSONAPI.configure` as `:upper_camelized`.
11761176

1177+
## Configuration
1178+
1179+
JR has a few configuration options. Some have already been mentioned above. To set configuration options create an
1180+
initializer and add the options you wish to set. All options have defaults, so you only need to set the options that
1181+
are different. The default options are shown below.
1182+
1183+
```ruby
1184+
JSONAPI.configure do |config|
1185+
#:underscored_key, :camelized_key, :dasherized_key, or custom
1186+
config.json_key_format = :dasherized_key
1187+
1188+
#:underscored_route, :camelized_route, :dasherized_route, or custom
1189+
config.route_format = :dasherized_route
1190+
1191+
#:basic, :active_record, or custom
1192+
config.operations_processor = :active_record
1193+
1194+
config.allowed_request_params = [:include, :fields, :format, :controller, :action, :sort, :page]
1195+
1196+
# :none, :offset, :paged, or a custom paginator name
1197+
config.default_paginator = :none
1198+
1199+
# Output pagination links at top level
1200+
config.pagination_links = true
1201+
1202+
config.default_page_size = 10
1203+
config.maximum_page_size = 20
1204+
1205+
# Output the record count in top level meta data for find operations
1206+
config.record_count_in_meta = false
1207+
config.record_count_meta_key = :record_count
1208+
1209+
config.use_text_errors = false
1210+
end
1211+
```
1212+
11771213
## Contributing
11781214

11791215
1. Fork it ( http://github.com/cerebris/jsonapi-resources/fork )

0 commit comments

Comments
 (0)