We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I have page model with tree structure. I also have scope based on status:
class Page < ApplicationRecord has_closure_tree STATUSES = %w[draft published].freeze enum status: STATUSES scope :published, -> { where(status: :published) } end
I need to create navigation menu which will display only published pages. How can I do this?
If I'm trying to use:
Page.published.hash_tree
I'm getting error:
NoMethodError: undefined method `[]=' for nil:NilClass
... and I understand why (after scope it's not a tree structure any more). Is there any way to achieve that?
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I have page model with tree structure. I also have scope based on status:
I need to create navigation menu which will display only published pages. How can I do this?
If I'm trying to use:
I'm getting error:
... and I understand why (after scope it's not a tree structure any more). Is there any way to achieve that?
Thanks!
The text was updated successfully, but these errors were encountered: