你应该创建一个插件(查看 Customization > Plugin 中链接的示例仓库),这样核心升级就能正常运行。不要“直接”修改源代码,否则维护起来会非常痛苦。使用 #documentation:devs 中的指南来入门。如果你需要获取更多数据,则需要扩展 Rails Serializers。不过,如果你的需求较简单,可以考虑使用自定义字段。
merefield
(Robert)
2
相關主題
| 話題 | 回覆 | 觀看 | 活動 | |
|---|---|---|---|---|
| Is there a way to modify Discourse endpoints through plugin? | 3 | 684 | 2019年一月8日 | |
| Discourse Code Modification for personal use | 2 | 1048 | 2020年四月20日 | |
| Add new API endpoints | 6 | 1424 | 2019年二月23日 | |
| How to make changes on backend side of discourse application using rails | 7 | 996 | 2022年十二月26日 | |
| New columns in directory (/users) | 6 | 2832 | 2019年十月16日 |