Forum: Ruby on Rails Two fields in model but only need to store last field selected by user

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E67b403d10e3525a29c15e64841f44f5?d=identicon&s=25 Lekha P. (lekha_p)
on 2013-10-04 11:54
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.
Db9510c96a4c0f6f88c9aa39ab24211a?d=identicon&s=25 jsnark (Guest)
on 2013-10-04 14:47
(Received via mailing list)
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.
This topic is locked and can not be replied to.