[Rails] Re: Rails Acts_as_tree and many to many associations (Product, Category) Issue

2011-02-23 Thread Anshu Agr
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

[Rails] Re: Rails Acts_as_tree and many to many associations (Product, Category) Issue

2011-02-23 Thread Phoenix Rising
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

[Rails] Rails Acts_as_tree and many to many associations (Product, Category) Issue

2011-02-22 Thread Anshu Agr
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

[Rails] acts_as_tree test fails : duplicate entry # for key #

2010-03-11 Thread steve.gooberman-hill
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

Re: [Rails] acts_as_tree question

2010-02-08 Thread Gianluca Tessarolo
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

[Rails] acts_as_tree question

2010-02-08 Thread db_333
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 %> +

[Rails] acts_as_tree error

2009-09-21 Thread Jason
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

[Rails] acts_as_tree -- how to create new child

2009-08-05 Thread steven_noble
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

[Rails] acts_as_tree

2009-08-05 Thread doug
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

[Rails] acts_as_tree

2009-02-09 Thread Ralph Herve
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

[Rails] acts_as_tree?? Heirarchy needed

2008-12-10 Thread Iain Adams
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