Hi,

Can any body help me to prepare a small demo of mongoid oriented
application that will
hold contacts details of person.

1.CRUD operation on contacts using scaffold.

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"

I am going through google but not getting expected support.

Every day i use to stretch my hair when ever coming around this mongodb
feature.
+++++++++++++++
Pravin Mishra

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

Search Discussions

  • Gautam Rege at Oct 21, 2011 at 12:00 pm
    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 rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 21, '11 at 11:31a
activeOct 21, '11 at 12:00p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Pravin Mishra: 1 post Gautam Rege: 1 post

People

Translate

site design / logo © 2022 Grokbase