# Development

**URL:** https://meta.discourse.org/c/dev/7.md?page=122

[最新版本](https://meta.discourse.org/latest.md) · [分類](https://meta.discourse.org/categories.md) · [標簽](https://meta.discourse.org/tags.md)

**Page:** 123

---

## [使用 Golang 向删除 API 方法传递参数](https://meta.discourse.org/t/passing-params-to-delete-api-method-using-golang/83502)

<div class="topic-metadata">

**Author:** [@richp10](https://meta.discourse.org/u/richp10)\
**回覆:** 4\
**Last updated:** [2018年三月21日 21:56 UTC](https://meta.discourse.org/t/passing-params-to-delete-api-method-using-golang/83502 "2018-03-21T21:56:25Z")

</div>

我正在使用 Go 尝试通过 API 从群组中移除用户。我有把握端点是正确的——/groups/148/members.json，其中 148 是群组的 ID。根据 API 规范，我似乎需要使用 DELETE 方法……

---

## [获取用户邮箱，emails.json 似乎无法正常工作](https://meta.discourse.org/t/get-user-email-emails-json-seems-not-working/83477)

<div class="topic-metadata">

**Author:** [@borgymanotoy](https://meta.discourse.org/u/borgymanotoy)\
**回覆:** 1\
**Last updated:** [2018年三月21日 22:47 UTC](https://meta.discourse.org/t/get-user-email-emails-json-seems-not-working/83477 "2018-03-21T22:47:56Z")

</div>

你好，我正在寻找获取用户电子邮件地址的方法。 获取用户信息的链接为： https://meta.discourse.org/u/USERNAME.json 但该链接不包含电子邮件地址。 我从一篇帖子中读到： https://meta.discou…

---

## [Rewrite in Elm?](https://meta.discourse.org/t/rewrite-in-elm/48677)

<div class="topic-metadata">

**Author:** [@DevinRhode2](https://meta.discourse.org/u/DevinRhode2)\
**回覆:** 27\
**Last updated:** [2016年八月17日 23:06 UTC](https://meta.discourse.org/t/rewrite-in-elm/48677 "2016-08-17T23:06:36Z")

</div>

Curious to hear the community’s thoughts on Elm: http://elm-lang.org I’m already well versed in Ember and am looking for a useful Ember app to try and rewrite in Elm as a way to learn Elm. Discourse is a very advanced E…

---

## [Postman / Zapier - 将群组添加到类别](https://meta.discourse.org/t/postman-zapier-add-group-to-category/83338)

<div class="topic-metadata">

**Author:** [@mikechristopher](https://meta.discourse.org/u/mikechristopher)\
**回覆:** 0\
**Last updated:** [2018年三月19日 20:07 UTC](https://meta.discourse.org/t/postman-zapier-add-group-to-category/83338 "2018-03-19T20:07:34Z")

</div>

现在我不会假装自己是任何熟练的开发者，因为我实际上不会写代码，但我擅长使用 Postman 和 Zapier 等工具。 我试图将一个群组添加到一个分类中——我知道可以用 Postman 通过以下方式完成： Key:Valu…

---

## [在标记队列中渲染自定义帖子字段](https://meta.discourse.org/t/rendering-custom-post-field-in-flagged-queue/81991)

<div class="topic-metadata">

**Author:** [@george.thomson](https://meta.discourse.org/u/george.thomson)\
**回覆:** 13\
**Last updated:** [2018年三月19日 17:29 UTC](https://meta.discourse.org/t/rendering-custom-post-field-in-flagged-queue/81991 "2018-03-19T17:29:52Z")

</div>

你好， 我尝试在插件出口中渲染自定义字段，但似乎无法访问它。所使用的出口是位于 \`/app/assets/javascripts/admin/templates/components/…\` 中的 \`flagged-post-below-controls\` 插件出口。

---

## [当插件文件指定 gem 版本范围时，Bootstrap 启动失败](https://meta.discourse.org/t/bootstrap-fails-when-plugin-file-specifies-gem-version-range/82896)

<div class="topic-metadata">

**Author:** [@jonathon](https://meta.discourse.org/u/jonathon)\
**回覆:** 7\
**Last updated:** [2018年三月19日 12:36 UTC](https://meta.discourse.org/t/bootstrap-fails-when-plugin-file-specifies-gem-version-range/82896 "2018-03-19T12:36:17Z")

</div>

据我所知，在 Ruby 文件中指定 gem 版本范围是合法的，例如： gem 'ruby-saml', '~\>1.7' gem 'omniauth-saml', '~\>1.10' 手动运行 gem install 也会按预期成功，例如： $ gem inst…

---

## [Custom fields added by plugins - when would they be visible?](https://meta.discourse.org/t/custom-fields-added-by-plugins-when-would-they-be-visible/26598)

<div class="topic-metadata">

**Author:** [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)\
**回覆:** 7\
**Last updated:** [2018年三月18日 11:39 UTC](https://meta.discourse.org/t/custom-fields-added-by-plugins-when-would-they-be-visible/26598 "2018-03-18T11:39:05Z")

</div>

Continuing the discussion from Adding and editing user custom fields: Would these fields even show up on user / admin pages I would have assumed it would only be the user\_field\_X which are added via the site/customize…

---

## [打开已预填内容的编辑器](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979)

<div class="topic-metadata">

**Author:** [@duranmla](https://meta.discourse.org/u/duranmla)\
**回覆:** 1\
**Last updated:** [2018年三月14日 18:59 UTC](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979 "2018-03-14T18:59:09Z")

</div>

我已经创建了一个主题，其中提供了关于如何打开预填信息的作曲器的信息。此外，我还获得了一些关于操作工作的有用回答。这些主题可以在以下位置找到： Accessin…

---

## [Getting Current user route and path](https://meta.discourse.org/t/getting-current-user-route-and-path/56723)

<div class="topic-metadata">

**Author:** [@Alavi1412](https://meta.discourse.org/u/Alavi1412)\
**回覆:** 5\
**Last updated:** [2018年三月14日 16:11 UTC](https://meta.discourse.org/t/getting-current-user-route-and-path/56723 "2018-03-14T16:11:14Z")

</div>

Is there any way to find the current route of user? for example if user is watching homepage it return something like homepage. or if user is watching a category with id of 52 (just an example) it returns category 52 o…

---

## [您是如何使用 Webhooks 的？](https://meta.discourse.org/t/how-are-you-using-webhooks/82712)

<div class="topic-metadata">

**Author:** [@Biscuit](https://meta.discourse.org/u/Biscuit)\
**回覆:** 1\
**Last updated:** [2018年三月13日 20:29 UTC](https://meta.discourse.org/t/how-are-you-using-webhooks/82712 "2018-03-13T20:29:27Z")

</div>

我很想听听大家目前是如何使用 Discourse Webhooks 的？ 大家有哪些创意想法？

---

## [Widget 属性说明](https://meta.discourse.org/t/widget-attribute-clarifications/82870)

<div class="topic-metadata">

**Author:** [@tshenry](https://meta.discourse.org/u/tshenry)\
**回覆:** 3\
**Last updated:** [2018年三月13日 19:09 UTC](https://meta.discourse.org/t/widget-attribute-clarifications/82870 "2018-03-13T19:09:04Z")

</div>

随着我继续在 Discourse 开发的兔子洞中深入，我遇到了一些需要澄清的地方（如果可能的话）。我可能忽略了一些极其明显的东西，但以下是我需要帮助的地方…

---

## [Importer support for migrated passwords](https://meta.discourse.org/t/importer-support-for-migrated-passwords/70543)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 7\
**Last updated:** [2018年三月12日 17:22 UTC](https://meta.discourse.org/t/importer-support-for-migrated-passwords/70543 "2018-03-12T17:22:49Z")

</div>

I mostly think that importing passwords from a legacy forum is a Bad Idea. There are almost certainly a bunch of horrible passwords and it seems like making people change their password when they get a shiny new forum is…

---

## [使用预填信息打开 Composer](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915)

<div class="topic-metadata">

**Author:** [@duranmla](https://meta.discourse.org/u/duranmla)\
**回覆:** 2\
**Last updated:** [2018年三月13日 18:18 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915 "2018-03-13T18:18:21Z")

</div>

你好， 我遇到了一个问题：无法在预填信息的情况下打开编辑器，或者如果这种情况过于复杂，是否可以通过自定义组件/小部件直接创建一个主题。该问题的背景是……

---

## [如何通过纯标记将组件附加到小部件？](https://meta.discourse.org/t/how-to-attach-a-component-to-a-widget-with-just-markup/82634)

<div class="topic-metadata">

**Author:** [@duranmla](https://meta.discourse.org/u/duranmla)\
**回覆:** 0\
**Last updated:** [2018年三月9日 17:00 UTC](https://meta.discourse.org/t/how-to-attach-a-component-to-a-widget-with-just-markup/82634 "2018-03-09T17:00:03Z")

</div>

大家好，我是 Discourse 开发的新手，目前正在一个项目中创建几个插件（用于特定目的）。我正在开发一个插件，用于在网站上显示分类栏，并具有一些其他巧妙的效果，以展…

---

## [Help! with the Anonymous feature on discourse](https://meta.discourse.org/t/help-with-the-anonymous-feature-on-discourse/70135)

<div class="topic-metadata">

**Author:** [@ogeh47](https://meta.discourse.org/u/ogeh47)\
**回覆:** 2\
**Last updated:** [2018年三月9日 05:29 UTC](https://meta.discourse.org/t/help-with-the-anonymous-feature-on-discourse/70135 "2018-03-09T05:29:24Z")

</div>

Hello, everyone, I am new to the discourse platform and I’m currently building a bottom bar navigation that will only be displayed on mobile phones and I cannot seem to get the anonymous feature to work, I want to make a…

---

## [修改 topics/show.html.erb 的最佳方法](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478)

<div class="topic-metadata">

**Author:** [@Magnetidog](https://meta.discourse.org/u/Magnetidog)\
**回覆:** 2\
**Last updated:** [2018年三月8日 14:18 UTC](https://meta.discourse.org/t/best-way-to-modify-topics-show-html-erb/82478 "2018-03-08T14:18:58Z")

</div>

我们需要自定义 topics/show.html.erb 文件以添加一些自定义功能。我已在本地编辑了该模板，一切正常，但我想知道是否有标准或首选的方式来编辑这些文件…

---

## [将 jQuery 升级到 3.3.1 版本](https://meta.discourse.org/t/upgrading-jquery-to-version-3-3-1/82477)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**回覆:** 0\
**Last updated:** [2018年三月8日 03:37 UTC](https://meta.discourse.org/t/upgrading-jquery-to-version-3-3-1/82477 "2018-03-08T03:37:36Z")

</div>

我刚刚将 jQuery 从 2.2.0 版本（已有 2 年历史）升级到了 3.3.1。 官方声明中，jQuery 已正式停止对 IE 8 及以下版本的支持。但在实际应用中……嗯……jQuery 移除旧代码的进程一直比较缓慢。 这里有一份详尽的指南 ……

---

## [能否阻止主题更新覆盖用户自定义资源？](https://meta.discourse.org/t/possible-to-prevent-theme-updates-from-replacing-user-customized-assets/82469)

<div class="topic-metadata">

**Author:** [@tshenry](https://meta.discourse.org/u/tshenry)\
**回覆:** 2\
**Last updated:** [2018年三月8日 01:29 UTC](https://meta.discourse.org/t/possible-to-prevent-theme-updates-from-replacing-user-customized-assets/82469 "2018-03-08T01:29:38Z")

</div>

我遇到了一个有趣的难题。这有点难以解释，所以如果我有需要澄清的地方，请告诉我。我的意图是在 SCSS 文件中设置一个硬编码的变量名（例如 \`$image-url\`），使其指向 …

---

## [搜索 API 仅提供 5 个主题结果](https://meta.discourse.org/t/search-api-only-have-5-topic-result/82425)

<div class="topic-metadata">

**Author:** [@AresX](https://meta.discourse.org/u/AresX)\
**回覆:** 1\
**Last updated:** [2018年三月7日 18:14 UTC](https://meta.discourse.org/t/search-api-only-have-5-topic-result/82425 "2018-03-07T18:14:08Z")

</div>

你好，我使用了搜索 API https://parrotsec-china.org/search/query.json 来搜索主题，但返回的 JSON 结果中只有 5 条主题，为什么会这样？

---

## [Ubuntu 安装程序是否可以直接使用？](https://meta.discourse.org/t/does-the-ubuntu-install-work-as-is/82433)

<div class="topic-metadata">

**Author:** [@Sheeply](https://meta.discourse.org/u/Sheeply)\
**回覆:** 1\
**Last updated:** [2018年三月7日 17:18 UTC](https://meta.discourse.org/t/does-the-ubuntu-install-work-as-is/82433 "2018-03-07T17:18:54Z")

</div>

我在 PC 上安装了 Ubuntu，而不是折腾。我按照这个安装指南操作： https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md 看起来所有组件都已安装成功，但在执行“bundle…”时失败了。

---

## [客户端：如何从“/posts”服务端响应中捕获数据？](https://meta.discourse.org/t/client-side-capturing-data-from-posts-server-side-response/82209)

<div class="topic-metadata">

**Author:** [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)\
**回覆:** 4\
**Last updated:** [2018年三月5日 22:06 UTC](https://meta.discourse.org/t/client-side-capturing-data-from-posts-server-side-response/82209 "2018-03-05T22:06:34Z")

</div>

我已在用户创建新主题时服务器端返回的响应中包含了一个字段。我想用此数据更新客户端。该字段名为 stripe\_txn\_balance，并出现在以下 re…

---

## [用于训练的 Discobot](https://meta.discourse.org/t/discobot-for-training/81316)

<div class="topic-metadata">

**Author:** [@Timothy\_Vail](https://meta.discourse.org/u/Timothy_Vail)\
**回覆:** 25\
**Last updated:** [2018年三月5日 21:09 UTC](https://meta.discourse.org/t/discobot-for-training/81316 "2018-03-05T21:09:23Z")

</div>

你好， 我想自定义 Discobot，用于为员工提供培训，即向他们推送预设的信息帖子。 我该如何将 Discobot 设置为针对任何我想要的主题进行培训？ 谢谢， Ti…

---

## [在 JRuby 上运行 Discourse](https://meta.discourse.org/t/getting-discourse-running-on-jruby/81273)

<div class="topic-metadata">

**Author:** [@headius](https://meta.discourse.org/u/headius)\
**回覆:** 16\
**Last updated:** [2018年三月5日 08:25 UTC](https://meta.discourse.org/t/getting-discourse-running-on-jruby/81273 "2018-03-05T08:25:21Z")

</div>

大家好！ 我参与 JRuby 项目，并在过去一年中多次尝试部署 Discourse。这意味着您可以为整个站点运行单个 Discourse 进程，并可能使用…

---

## [如何在登录用户中隐藏品牌标题？](https://meta.discourse.org/t/how-to-hide-brand-header-for-logged-in-users/312625)

<div class="topic-metadata">

**Author:** [@\_vincent](https://meta.discourse.org/u/_vincent)\
**回覆:** 1\
**Last updated:** [2018年三月5日 05:20 UTC](https://meta.discourse.org/t/how-to-hide-brand-header-for-logged-in-users/312625 "2018-03-05T05:20:11Z")

</div>

很棒的主题组件。你打算如何为已登录用户隐藏它？

---

## [Brewfile 是否已过期？](https://meta.discourse.org/t/brewfile-is-out-of-date/81858)

<div class="topic-metadata">

**Author:** [@shoshber](https://meta.discourse.org/u/shoshber)\
**回覆:** 1\
**Last updated:** [2018年三月1日 09:15 UTC](https://meta.discourse.org/t/brewfile-is-out-of-date/81858 "2018-03-01T09:15:52Z")

</div>

$ brew bundle 错误：homebrew/dupes 已弃用。由于该仓库中的所有公式均已迁移，此仓库现已为空。 执行 homebrew/dupes 的添加操作失败！

---

## [在会员部分添加计费板块](https://meta.discourse.org/t/adding-a-billing-section-in-the-member-section/81610)

<div class="topic-metadata">

**Author:** [@Francois\_Douville](https://meta.discourse.org/u/Francois_Douville)\
**回覆:** 7\
**Last updated:** [2018年二月28日 17:31 UTC](https://meta.discourse.org/t/adding-a-billing-section-in-the-member-section/81610 "2018-02-28T17:31:16Z")

</div>

我使用的是 Memberful-Discourse 集成。 我想在这里添加一个“账单”部分： \[billing\] 实际上，当用户点击“账单”时，将会跳转到该用户的 Memberful 账户。我将添加一个简单的…

---

## [如何将数据从插件传递到应用/视图模板？](https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528)

<div class="topic-metadata">

**Author:** [@Stranik](https://meta.discourse.org/u/Stranik)\
**回覆:** 1\
**Last updated:** [2018年二月28日 02:19 UTC](https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528 "2018-02-28T02:19:16Z")

</div>

我使用插件帮助创建了一个测试页面。 通过在相应文件中放置以下代码实现。例如，在 plugin.rb 中： Discourse::Application.routes.append do get '/help' =\> 'discourse\_help/help#my\_page' end…

---

## [插件可以添加 Webhook 吗？](https://meta.discourse.org/t/can-a-plugin-add-a-webhook/81361)

<div class="topic-metadata">

**Author:** [@jack2](https://meta.discourse.org/u/jack2)\
**回覆:** 7\
**Last updated:** [2018年二月27日 11:27 UTC](https://meta.discourse.org/t/can-a-plugin-add-a-webhook/81361 "2018-02-27T11:27:33Z")

</div>

我正在开发一个与外部 Web 应用通信的插件。该 Web 应用还通过 Webhook 获知 Discourse 中的变更。 目前，安装该插件较为复杂，因为它需要…

---

## [让 user custom\_field 对 Composer 连接器可用？](https://meta.discourse.org/t/making-user-custom-field-available-to-composer-connector/81601)

<div class="topic-metadata">

**Author:** [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)\
**回覆:** 2\
**Last updated:** [2018年二月27日 08:18 UTC](https://meta.discourse.org/t/making-user-custom-field-available-to-composer-connector/81601 "2018-02-27T08:18:53Z")

</div>

我即将完成一个新插件，该插件允许会员付费将他们的主题置顶。 不过还有一件小事让我有些困扰。我将用户的余额存储在一个用户自定义字段中，并在支付时更新余额…

---

## [根据用户名获取用户头像](https://meta.discourse.org/t/getting-user-avatar-from-username/81540)

<div class="topic-metadata">

**Author:** [@Bolarinwa\_Balogun](https://meta.discourse.org/u/Bolarinwa_Balogun)\
**回覆:** 2\
**Last updated:** [2018年二月26日 21:38 UTC](https://meta.discourse.org/t/getting-user-avatar-from-username/81540 "2018-02-26T21:38:19Z")

</div>

你好，我正在开发一个插件，想要显示用户的头像。有没有办法通过用户名获取用户头像？

[上一頁](https://meta.discourse.org/c/dev/7.md?page=121)

[下一頁](https://meta.discourse.org/c/dev/7.md?page=123)
