- helper 文件的组织管理和使用
https://til.codes/using-helper-methods-and-helper-modules-in-rails-grape-to-keep-the-code-dry/
- Entity 的使用
2.1 present 放在hash内返回
# 返回 格式
{
status: 1,
objects: [{id:12, name: xxx}, {id: 13, name :xxxx}]
}
写法
present :status, 1
present :objects, objects, with: ObjectEntity::Index
参考:
https://ruby-china.org/topics/28999
网友评论