Hello Gurus, I have a form which has a phone_no field. I want to provide 3 text fields to user to split and enter the phone number in country_code, state_code and the number which will be contacted and entered in to the phone_no field with some delimiter (-) The same functionality will be for address_1, and address_2 fields, which will be merged in to a single address field. any pointers suggestions to implement this functionality. Thanks in advance - S -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-20 17:15 UTC
Re: Combining 2 hash fields in a single database field
Sachin wrote:> Hello Gurus, > I have a form which has a phone_no field. I want to provide 3 text > fields to user to split and enter the phone number in country_code, > state_code and the number which will be contacted and entered in to > the phone_no field with some delimiter (-) > > The same functionality will be for address_1, and address_2 fields, > which will be merged in to a single address field. > any pointers suggestions to implement this functionality. >Just munge the strings in the model''s before_save or constructor.> Thanks in advance > > - SBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for the pointer Marnen, i shall try it out. - S On Jul 20, 10:15 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Sachin wrote: > > Hello Gurus, > > I have a form which has a phone_no field. I want to provide 3 text > > fields to user to split and enter the phone number in country_code, > > state_code and the number which will be contacted and entered in to > > the phone_no field with some delimiter (-) > > > The same functionality will be for address_1, and address_2 fields, > > which will be merged in to a single address field. > > any pointers suggestions to implement this functionality. > > Just munge the strings in the model''s before_save or constructor. > > > Thanks in advance > > > - S > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.