Hello i got this: class Matrix < ActiveRecord::Base set_table_name :matrix belongs_to :member, :foreign_key=>:userid acts_as_tree :foreign_key=>:parent end class Member < ActiveRecord::Base set_primary_key :userid has_many :matrix, :foreign_key=>:userid has_many :matrix, :foreign_key=>:parent has_many :payment, :foreign_key=>:userid has_many :paymentHistory, :foreign_key=>:userid validates_presence_of :name validates_presence_of :identification validates_presence_of :sponsor end i modeled my data like this because each member have more member through himself. My problem is when i try to create a new member: it says: Matrix expected, got Fixnum but if i erase the ''acts_as_tree'' from matrix model it works well, what could be??? to save the data in my controller i got: def create @member = Member.new(params[:member]) @new_matrix = Matrix.new respond_to do |format| if @member.save @new_matrix.userid = @member.userid parent = Member.find(params[:matrix]).userid @new_matrix.parent = parent @new_matrix.save flash[:notice] = ''Member was successfully created.'' format.html { redirect_to member_url(@member) } format.xml { head :created, :location => member_url(@member) } else format.html { render :action => "new" } format.xml { render :xml => @member.errors.to_xml } end end end PLeased heeelp mee! Best Regards, -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---