Hi,
Has an external table wich i connect through this code. So the table
"bestemming" is stored on the exterbal database fly2.
class External < ActiveRecord::Base
establish_connection :extern
self.abstract_class = true
end
class Bestemming < External
has_and_belongs_to_many :tags
belongs_to :land, :foreign_key => "landcode"
set_table_name "bestemmingen"
set_primary_key "bestemming_id"
end
On my rails app database fly1 i added to 2 tables for tagging.
CREATE TABLE `tags` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '''',
PRIMARY KEY (`id`)
)
CREATE TABLE `expenses_tags` (
`bestemming_id` int(11) NOT NULL default ''0'',
`tag_id` int(11) NOT NULL default ''0''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1)the relating table is in alphabetical order bestemming_tags
2)the field relating to a tag''s id is tag_id
3)the field relating to an bestemming''s id is bestemming_id(database
fly)
I added some tag-list code in my editing-form for bestemming. I got this
error.
Mysql::Error: Table ''fly2.bestemmings_tags'' doesn''t
exist: SHOW FIELDS
FROM bestemmings_tags
I goes to the wrong database!!!!
Help wanted please
--
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
-~----------~----~----~----~------~----~------~--~---