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