Displaying 20 results from an estimated 3000 matches similar to: "what are all these methods?!?! :)"
2006 Apr 20
4
Many to Many Category structure with itself
Basically, I''m trying to have a table called "categories" have a many to
many relationship with itself. But I also want each catagory to be able
to be "copied" into another category so it is essentially a child
category to more than one parent. To me the obvious way of doing this is
by creating another table called category_maps (and a model called
CategoryMap).
2009 Sep 10
1
undefined method `protect_against_forgery?'
When I use plugin ''railstree'' (http://www.hashcode.eti.br/?p=91) as
following code:
node = Node.new :label => menu_item.name,
:link_to_remote => {
:base => self,
:update =>
"container",
:url => {
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 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 Mar 10
8
multiple sub categories (parent-child)
hi.
base from the cookbook example, where each categories can have many
recipes,
id like the categories to have multiple sub categories, unlimited
levels.
please show some code, as i am new to Ruby and Ruby On Rails.
thanks
--
Posted via http://www.ruby-forum.com/.
2009 Feb 19
3
Associated child records not created on creation of a parent.
I am trying to create a record with association. Within the create
method, I would also like to pre-populate dependent (has_many) records
from a template in the database.
The child records are <u>mysteriously rolled back </u> if I insert
them in a loop. If I try to insert a single child record, it works.I
have read the books and tried to google my way out of this but am at a
dead
2006 Feb 02
3
acts_as_family_tree
For a project that I am working on I need to have a family tree. This
means that instead of having one parent each item has at most two. As
far as I know acts_as_tree only allows one parent_id. Any suggestions
on how to make a "acts_as_family_tree" ?
Thanks,
Mark
--
--------------------------------------------------------------------
I am Mark Daggett and I approve this message.
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.
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 Sep 14
5
Expecting field value and getting record
The following short console session illustrates the problem:
Loading development environment (Rails 2.3.2)
>> topic=BlogTopic.find(4)
=> #<BlogTopic id: 4, parent: 2, topic: "Topic Four", created_at:
"2009-07-13 21:31:22", updated_at: "2009-09-14 00:37:29">
>> topic.inspect
=> "#<BlogTopic id: 4, parent: 2, topic: \"Topic
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/.
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
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_<%=
2006 Apr 30
4
acts_as_ordered_tree
I need an ordered (sortable tree) and I just was thinking if somehting
like this is possible:
class Item< ActiveRecord::Base
acts_as_tree :order => "position"
acts_as_list :scope => ''parent_id = #{self.id}''
end
For my understanding mixing of two acts_as should be p?ssible, at least
in this case, right?
Unfortunatly the :scope is not working, I am not
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
--------------------------------------------------------------------------------------
2006 Feb 22
2
Newbie seeks helps ordering ancestors from acts_as_tree
I''m sure this is really obvious but I''m feeling my way here with rails
(and Ruby) and have tried a couple of things without success. So, can
anyone tell me the best way to reverse order the retuen list of
ancestors.
In the controller I have:
@ancestors = @category.ancestors
which returns an array starting at the parent and ending with the root.
When I then loop through the
2006 May 23
7
self-referencing has_many
Having a devil of a time finding records in a self-referencing has_many
table relationship.
Everything is working find looking at the has_many and the belongs_to
relationship.
But, when I try to find all "orphans", records that are neither a parent
nor a child, I can not find a query that work in ActiveRecord.
This query works in MySQL:
SELECT * FROM templates
LEFT JOIN templates
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 =
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