similar to: filter children with acts_as_tree

Displaying 20 results from an estimated 3000 matches similar to: "filter children with acts_as_tree"

2009 Feb 17
8
Converting Acts_As_Tree to Acts_As_Nested_Set
Hello, I have a tree structure that needs to be converted into a nested set. A great deal of work has already been done on the tree items, so maintaining the integrity of the id''s is mandatory. However I need the ability to access entire branches of the tree, which is what Nested set does. Does anyone have any suggestions on how to efficiently transfer the tree to the nested set and
2009 Aug 19
10
acts_as_list / acts_as_tree / acts_as_nested_set - which one
I am creating forum application which needs usage of acts_as_list or acts_as_tree or acts_as_nested_set. I am unable to decide among these. please could some one recommend from their experience? -- Posted via http://www.ruby-forum.com/.
2010 Feb 09
3
acts_as_tree question
Hi, I''m trying to implement a very simple acts_as_tree search in my index html. I am able to show the parents, with no issue, but the children will not show. I have something like this for the parent, which displays fine: <% for group in Group.roots %> <td> <tr> <a href="#" onclick="Effect.BlindDown(''show_<%=
2010 May 12
3
Best Gem For Threaded Comment Storage?
Dear List, Given that I am developing a rails 2.3.5 site, When it comes to storing threaded comments in a blog or forum, Then which plugin/gem should be considered "State of the Art"? I''m starting with these URLs: http://github.com/rails/acts_as_tree http://github.com/rails/acts_as_nested_set http://github.com/collectiveidea/awesome_nested_set
2010 Sep 11
10
Having difficulty with threaded comments, using acts_as_tree
I''ve been having problems making threaded comments for the last few days. Mainly with creating children and displaying the children. Currently, I have comments shown at the bottom of my articles show view. The top level comments work, but I do not really know how to implement a way for users to "reply" to the top level comments and take them to a form (the comment
2006 Mar 25
2
acts_as_tree wierdness with children.count and children.size
i am making a category tree and i iterate over the category using my counter_cache however it would show a different number than what was actually being represetned in the tree. Here is an example cat.children = [cat2, cat3] puts cat.children.size 2 puts cat.children_count 2 cat4.parent_id = cat.id cat4.save puts cat.children.size
2011 Feb 18
1
Rails plugins new official maintainers
Hey guys, This is the final list of the new maintainers of each plugin. We need two more things to do: First please the owners of the repos add the rest of the maintainers. Second I will add a note on each rails/plugin mentioning this repos updates. So from now on, if someone else is interested in helping/contributing please send a message to the appropriate repo owner. verification
2007 Feb 14
3
eager loading parents and children (acts_as_tree)
I am struggling with how to do eager loading of an acts_as_tree model. If the model Stuff acts_as_tree I know I can do this to get children as well: Stuff.find(:all, :include => :children) But what if the model I am including is the one that acts_as_tree? For example, say Picture belongs_to Category. Category acts_as_tree and I want to get all pictures that are members of a category that
2007 Apr 30
2
acts_as_tree
Hi folks, For my app, I needed to modify acts_as_tree (ActiveRecord::Acts::Tree) such that deleting a node would orphan sub-nodes, rather than deleting them. This is accomplished simply by allowing a :dependent option to the acts_as_tree method so that it can be set to :nullify. For my app, I simply did this by adding a file tree.rb to my lib directory and requiring it in the model. A number
2005 May 09
0
acts_as_tree / moving children
Greetings! I am working on a model that utilizes "acts_as_tree". I have a table named ''categories'' that has multiple root items, each each root item has several children. I cannot successfully separate those children from the tree. For example, if I delete a root category, I want the sub categories to become roots. I have tried setting the
2010 Dec 07
10
Advice on data design idea
I''m about to embark on a project and am seeking advice on my approach. I have an automotive site that needs to have shared categories. I''ve checked out different nested set, ancestral, acts_as_tree, acyclic plugins but feel they don''t exactly fit. So I am about to roll my own simple solution. Any feedback as to whether this looks good is appreciated. Essentially I
2006 Jan 25
0
acts_as_tree validation on parent.children.create
Validation does not appear to execute on a call to "parent.children.create". Anyone know if this is intentional, or am I doing something wacky? Thanks. -Theo
2006 Jan 16
2
acts_as_tree with Modified Preorder Traversal?
Has anyone extended Rails''s acts_as_tree to use the Modified Preorder Traversal algorithm? This is a really clever trick for optimizing access to trees stored in databases, as described lucidly in this article: http://www.sitepoint.com/article/hierarchical-data-database/2 It adds two integer fields, a "left counter" and "right counter", to each row. By
2006 Apr 12
2
Why doesn''t acts_as_tree support :scope?
I want to implement a unique category tree per user in my system, and I was hoping to use "acts_as_tree" on my category model. It seems as if acts_as_tree makes the assumption that the entire table the model is off of is one large tree. I actually want each user to have their own category trees all stored in the category table so I need it to scope off of the user_id.
2006 Jun 17
2
URL based on acts_as_tree using routes
Hi There! I''d like some feedback before I try to implement some funky rails routes based on an acts_as_tree model. I have a Page model that acts_as_tree. I''d like the URLs to look something like this: http://localhost/about-us/staff/jeff or, another example... http://localhost/what-we-do/products/our-great-cms/features/faqs/ So, as many sub-nodes the user creates,
2006 May 30
2
acts_as_tree, acts_as_list and is invincible (help!)
So I have the following model class Topic < ActiveRecord::Base belongs_to :topic has_many :topics, :order => :position acts_as_tree :order => :position acts_as_list :scope => :topic_id end that I use for a site''s navigation. Everything (list, create, edit, even the drag&drop sort) works fine, except the destroy function, which the vanilla version def destroy
2006 Jun 08
2
counter_cache is not looking for children_count with acts_as_tree
Hi there, the acts_as_tree API says that I can set a counter cache and that it will automatically increment the "children_count" column. I did that but when I create a new page it asks for a "pages_count" column instead. Here is the relevant part of page.rb model: class Page < ActiveRecord::Base acts_as_tree :order => :position, :counter_cache => true
2006 Dec 25
2
Active Record acts_as_tree and leaf depth
Using acts_as_tree, is it possible to get information of the depth a tree leaf in relation to the root? Or is available to derive information to save in the way "position" can be derived and saved for acts_as_list. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2006 Feb 03
2
acts_as_tree counter_cache behavior is different than API docs
Before I file a ticket, I''ll query ya''ll about this: The API docs for acts_as_tree''s counter_cache is to create a database column called "children_count" to hold the counter_cache. I have enabled this option in my model. While writing tests I wrote a test for creating children from the a parent: message = @forum_message["parent"].find child =
2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
I just switched from using the standard "id" column into using my own primary key and generating my own unique id for each record. But, this breaks acts_as_tree. Because my new primary key is not an integer, it breaks the SQL query as follows: StatementInvalid in PagesController#create --------------------------------------------------------------------------------------