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 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 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 .
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.


--
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

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 12 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 5, '12 at 4:33p
activeJan 6, '12 at 7:45p
posts12
users6
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase