Created
September 11, 2012 20:24
Revisions
-
manfe revised this gist
Sep 11, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,2 @@ = f.association :cities, :collection => State.all, :as => :grouped_select, :group_method => :cities, :group_label_method => :name -
manfe revised this gist
Sep 11, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,2 @@ = f.association :cities, :collection => State.all, :as => :grouped_select, :group_method => :cities, :group_label_method => :name -
manfe revised this gist
Sep 11, 2012 . 2 changed files with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1 @@ = f.association :cities, :collection => State.all, :as => :grouped_select, :group_method => :cities, :group_label_method => :name This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,4 @@ class City < ActiveRecord::Base validates :name, :presence => true belongs_to :state end -
manfe revised this gist
Sep 11, 2012 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,5 +3,4 @@ class State < ActiveRecord::Base validates :name, :presence => true has_many :cities, :order => :name #this order will show the cities in alphabetical order inside each optgroup end -
manfe created this gist
Sep 11, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ = f.association :cities, :collection => State.all, :as => :grouped_select, :group_method => :cities, :group_label_method => :name This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ class City < ActiveRecord::Base attr_accessible :name validates :name, :presence => true belongs_to :state end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ class State < ActiveRecord::Base attr_accesible :name validates :name, :presence => true has_many :cities, :order => :name #this order will show the cities in alphabetical order inside each optgroup end