Skip to content

Instantly share code, notes, and snippets.

@knowuh
Created December 21, 2011 14:46
Show Gist options
  • Save knowuh/1506279 to your computer and use it in GitHub Desktop.
Save knowuh/1506279 to your computer and use it in GitHub Desktop.
def district_choices
if @state
districts = Portal::District.find(:all, :conditions => {:state => @state })
return districts.map { |d| {:id => d.id , :name => d.name }}
end
default = Portal::District.default
return {:id => default.id, :name => default.name }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment