# 커스텀 필드 기준으로 주제 가져오기?

**URL:** <https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879>\
**Category:** Development\
**Created:** [8월 9, 2021, 9:39오후 UTC](https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879 "2021-08-09T21:39:27Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)\
**Post date:** [8월 13, 2021, 2:04오전 UTC](https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879/10 "2021-08-13T02:04:13Z")

</div>

정보 주셔서 감사합니다.

> [@angus](#):
>
> 즉, discovery 구조를 확장하지 않는다면,

커스텀 필드 값과 일치하는 주제만 가져오는 가장 쉬운 방법이 무엇이든 상관없이 기꺼이 따르겠습니다. 현재 `/fun_levels/:fun_level` 경로에 `{{topic-list}}` 컴포넌트를 로드하는 작동 중인 루트/경로/템플릿이 이미 있습니다. 다시 말해, 그 방식이 해당 커스텀 필드 값을 검색하는 것(ajax(/search))이라면 그것도 괜찮습니다. 점점 더 그것이 가장 직관적인 방법이라고 생각하고 있습니다. 다만 아직 제대로 작동하게 만들지 못했습니다.

그리고 명확히 하자면, 제 현재 방법은 다음과 같습니다.

1. ajax로 주제를 가져옵니다 (올바른 엔드포인트가 무엇인지, 또는 해당 엔드포인트를 어떻게 설정해야 하는지 파악하는 것이 핵심입니다),
2. 결과를 파싱하고,
3. `component.set('showTopics', parsed-result)`를 수행하여 주제를 `{{topic-list topics=showTopics}}`에 로드합니다.

> [@angus](#):
>
> `list_controller.rb`에 매핑된 엔드포인트를 호출하는 클라이언트 측 루트와 ajax 호출도 필요합니다.

이 방식은 제게 다소 추상적으로 느껴집니다. `list_controller`의 `def topics_by` 같은 메서드들을 볼 수 있지만, 그 중 하나의 메서드를 가져와 커스텀 필드 값에 기반하여 주제를 반환하도록 수정하는 방법은 무엇인가요?

---

_[View the full topic](https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879)._
