search for: continent_id

Displaying 3 results from an estimated 3 matches for "continent_id".

2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables CREATE TABLE continents ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE countries ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, continent_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; I generate scaffolds for country and for continent I modify the models and add belongs_to and has_one: class Continent < ActiveRecord::Base belongs_to :country end class Country < ActiveRecord::Base has...
2008 May 15
1
Remove controller name from URL > nested routes
Hi.. There are my nested routes map.resources :continent do |continent| continent.resources :land do |land| land.resources :destination end end By example it generates this url http://example/continent/azie/land/japan/destination/aomori I want http://example/continent/azie/japan/aomori How can i realize this...? Grtz...remco -- Posted via
2008 Nov 18
0
Scoping option_groups_from_collection_for_select
...the option_key and option_value methods to some particular scope? For instance, using the sample code in rdoc: class Continent < ActiveRecord::Base has_many :countries # attribs: id, name end class Country < ActiveRecord::Base belongs_to :continent # attribs: id, name, continent_id end I could get all countries grouped by continent with this: option_groups_from_collection_for_select (@continents, :countries, :name, :id, :name, 3) But say I had another class called Ally: class Alliance < ActiveRecord::Base has_many :countries #reciprocal belongs_to added to c...