Hi Phoenix Rising,
Thanks for looking at my issue. I have UTF encoding for my databases and
also
for the rails app.
My hunch is that it got to do something with category table having
parent_id for acts_as_tree plugin requirement. Every time, I add a
children of root category
the root category
Hey Anshu,
Taking a look at the code you posted, I don't know for sure why it
would be repeating every so often, but you could try adding a unique
index on the categories table to force the database to "break" when a
duplicate is inserted. Obviously you might not want to do this with
production co
Hi,
I want to create simple many to many association between my product and
category model. Category model currently also acts_as_tree for
navigation. The code works fine but not sure why after updating product
categories, parent category is also inserted repeatedly. This is
surprising because new
Hi,
I've set up a model as follows
class EquipmentPrice < ActiveRecord::Base
acts_as_tree :order => "id"
...
end
which has the following db migration
class CreateEquipmentPrices < ActiveRecord::Migration
def self.up
create_table :equipment_prices do |t|
t.integer :id
t
Hi,
I think you've made a little mistake...
The correct form is this:
<% for group in Group.roots %>
...
<%= link_to (group.name), group %>
...
<% for child in group.children %>
...
<%= link_to (child.name), child %>
...
Notice the use of "group.children" instead "Group.childre
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 %>
+
I am getting the following error when I attempt to use acts_as_tree. I
am new to this relationship and am stuck.
undefined method `acts_as_tree'
Model
class Rental < ActiveRecord::Base
acts_as_tree :order => "sort_order"
validates_presence_of :name
validates_numericality
I have:
#
In the Projects model...
acts_as_tree :order => "name"
###
In the Projects/show view...
<%= link_to 'Create Subproject', new_project_path, { :parent =>
@project.id } %>
###
In the Projects controller...
def new
@project = Project.new
@project.parent_id = :parent
My goal is to use nested elements to display a hierarchical view
of an entire table. It is my understanding that all acts_as_tree does
is make available 3 additional methods: 'ancestors', 'root', and
'siblings'. As useful as these methods may be, I don't see how they
are going to help me achiev
i'm using the command script/plugin install acts_as_tree but i'm still
having
Plugin not found: ["acts_as_tree"]
any helps!!!
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hello,
I have a problem that I thought I could solve with acts_as_tree but
I'm thinking now that acts_as_tree doesn't quite fit the bill.
Basically I have a standard hierarchy with 1 difference:
Node 1
\ Leaf 1
\ Node 2
\ Leaf 2
\ Node 3
11 matches
Mail list logo