Created
October 4, 2010 20:19
-
-
Save fcastellanos/610351 to your computer and use it in GitHub Desktop.
This file contains 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 characters
class Dinner | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :title, :type => String | |
field :description, :type => String | |
field :hosted_by, type => String | |
field :contact_phone, type => String | |
field :address, type => String | |
references_one :country | |
validates_presence_of :title | |
end | |
class Country | |
include Mongoid::Document | |
field :name, :type => String | |
referenced_in :dinner | |
validates_presence_of :name | |
end | |
= form_for @dinner do |f| | |
... | |
.field | |
= f.label :country | |
= f.select :country, Country.find(:all).collect{ |c| [c.name,c.id]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment