lekha p.
2013-Oct-04 09:54 UTC
Two fields in model but only need to store last field selected by user
Hi, Please help me I have two fields in a form, One field stores photo, am using paperclip and another field stores link of picture from web. My problem is i have to store only one value of any field which user selects at last. Pls help me to do this. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93dd3bffdb769af3cb4891f79ae6671e%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
jsnark
2013-Oct-04 12:46 UTC
Re: Two fields in model but only need to store last field selected by user
I would use javascript and jquery to keep track of the user''s last selection. Then, also with javascript, intercept the submit and using ajax send the request containing only the last selection. On Friday, October 4, 2013 5:54:43 AM UTC-4, Ruby-Forum.com User wrote:> > Hi, > > > Please help me > I have two fields in a form, One field stores photo, am using paperclip > and another field stores link of picture from web. > My problem is i have to store only one value of any field which user > selects at last. Pls help me to do this. > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a194f57d-922b-4e88-bffc-1a603888eb20%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.