On 20 March 2015 at 06:17, Роман Ярыгин <330850@gmail.com> wrote:
> Hello! Please help with trouble (I think it must be obvious solution)
>
> I have code for displaying main menu:
>
> @main_menu = Page.where(active: true).arrange(order: :position)
>
> It grabs all nodes with active parameter is set to true. But if the parent
> node for some children is set to active:false, they connects to grandparent
> node, and so on. How to avoid this behavior, so if parent node is excluded
> then all children nodes become excluded too?
I think you will need to explain the associations between the models
for us to understand the question. Then explain exactly what is not
happening as you want.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuT0qphszKtVZMf%2B4ZiWhf85DQssn1xZCrGHQex2a6f9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment