Hi, this sounds like a javascript problem. Javascript is executed 
asynchroniously on your browser so clicking fast means that you are sending 
more than one submit from the same form, causing Rails to return more than once 
from the controller. There are probably many ways to avoid this but one is to 
put in a delay of say half a second in your javascript submit code.

Fra: rubyonrails-talk@googlegroups.com 
[mailto:rubyonrails-talk@googlegroups.com] På vegne af Javier Quarite
Sendt: 5. januar 2012 17:55
Til: rubyonrails-talk@googlegroups.com
Emne: Re: [Rails] Duplicate forms after click


On Thu, Jan 5, 2012 at 11:44 AM, Colin Law 
<clan...@googlemail.com<mailto:clan...@googlemail.com>> wrote:

Look in the rails log to see what is happening (development.log
assuming in development mode).
Once you understand what is happening you will be better placed to fix it.

Colin


Yes, I've done that and every time I click on that radio... it makes an update 
and it saves the chosen option, if I make 2 fast clicks (or N clicks) it 
renders 2 (or N ) partials.

In my log after doing the update in database, it renders the partial and after 
that it calls the update.js that I use, is there a way to avoid this behavior? 
or it something related to the javascript?

Thanks

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


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

Reply via email to