Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching within private topics? #332

Open
lawso017 opened this issue Jun 14, 2016 · 1 comment
Open

Searching within private topics? #332

lawso017 opened this issue Jun 14, 2016 · 1 comment

Comments

@lawso017
Copy link

lawso017 commented Jun 14, 2016

Any thoughts on how to enable searching for private topics? Ideally I'd like a search to return results from private_topics when you're within private_topics#index or private_topics#show.

I've added a #search method to my PrivateTopicsController via a decorator, but am unsure how to best mark up the search form in the nav header based upon the controller context.

@jayroh
Copy link
Member

jayroh commented Jul 19, 2016

@lawso017 great question. If you're looking to conditionally include a private topic search instead of a default, regular-topic, search I would start in app/views/thredded/shared/_nav.html.erb and maybe create a predicate method in the helper that returns which context you're currently in. Maybe something like in_private_topics?? Eg:

<%= render 'thredded/private_search/form',
  messageboard: messageboard_or_nil if in_private_topics? %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants