File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 234
234
235
235
You can specify that serializers use the lower-camel key format at the config, class or instance level.
236
236
237
- ```` ruby
237
+ ``` ruby
238
238
239
239
ActiveModel ::Serializer .setup do |config |
240
240
config.key_format = :lower_camel
@@ -245,17 +245,17 @@ class BlogLowerCamelSerializer < ActiveModel::Serializer
245
245
end
246
246
247
247
BlogSerializer .new (object, key_format: :lower_camel )
248
- ````
248
+ ```
249
249
250
250
## Changing the default association key type
251
251
252
252
You can specify that serializers use unsuffixed names as association keys by default.
253
253
254
- ```` ruby
254
+ ``` ruby
255
255
ActiveModel ::Serializer .setup do |config |
256
256
config.default_key_type = :name
257
257
end
258
- ````
258
+ ```
259
259
260
260
This will build association keys like ` comments ` or ` author ` instead of ` comment_ids ` or ` author_id ` .
261
261
@@ -932,7 +932,7 @@ now generates:
932
932
class PostSerializer < ApplicationSerializer
933
933
attributes :id
934
934
end
935
- ````
935
+ ```
936
936
937
937
# Design and Implementation Guidelines
938
938
You can’t perform that action at this time.
0 commit comments