Pravin,
 mongoid.org has very clear instructions on how to setup fields in your
model. What code have you already written? Are you facing any problems? I
would recommend, you write some code rather than searching google for a
readymade solution! :)

Fields

a) Name of preson-> String
> b) Phone->will split in two part(i m not sure abt how it work but here need
> to initialize a object that will take care of this)[it is one of prominent
> feature of mongodb]
>    -Country Code->String
>    -Number->String
> c)Email(will multiple) ->Array
> d)Address(will Multiple)-> but wanted to store in other table named as
> "address" will hold field "details"
>

class Person
   include Mongoid::Document

   field :name, type: String
   field :phone, type: Array  # keep area code as phone[0] and phone[1] as
the number if required.
   ...

   has_many :addresses
end

class Address
   include Mongoid::Document

   field :street, type: String
   ...

   belongs_to :person
end

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to