------ art_5145_16742147.1203644644779 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/2/21, Alexey Nik <sc_out / tut.by>: > > Jesse Hu wrote: > > 2008/2/20, Alexey Nik <sc_out / tut.by>: > >> > - > >> I try lower case and got error : undefined method `id for > >> #<FolderTree:0x54060b0> > >> --- > >> > >> Does anybody have solution of this problem ? > >> -- > >> Posted via http://www.ruby-forum.com/. > >> > >> > > It has no relation to the character case of field names in db. You'd > > better > > use lower case string for the function name in Ruby. > > > > How is your db migration file (001_create_fold_trees.rb > > ) for the FoldTree model like? > > it's conetns of 001_create_folder_trees.rb : > class CreateFolderTrees < ActiveRecord::Migration > def self.up > create_table :folder_trees do |t| > end > end > > def self.down > drop_table :folder_trees > end > end > -- > Posted via http://www.ruby-forum.com/. > > That's the problem. You need to define columns for the folder_trees table like this: *def self.up create_table :folder_trees do |t|* * t.column :client_name, :string* * t.column :tree_name, :string end end* ** *Then run rake task "rake db:migrate" to create the table in db.* -- Cheers, Jesse ------ art_5145_16742147.1203644644779--