The problem is that your users, like most users, are not very bright.
They double-click (or in this case, triple-click) submit
buttons. :disable_with will pretty much solve the issue; anybody with
enough savvy to have JS disabled likely knows that you don't double-
click submit buttons.
--Matt Jo
That's a cool idea.
I will also have a play around with that this evening.
Thank you very much.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
After talking to some friends of mine, the IP address is NOT a good
idea...looks like I'll be looking at a cookie solution instead.
On Aug 27, 7:43 am, "Matt W." wrote:
> I have a similar problem that I'm working on, but I was going to take
> a slightly different approach.
>
> My problem is that
And maybe one more.. Again, I know you dislike javascript, but.. :)
This isn't exactly generic - I'm pulling it straight out of something
I'm doing right now. Why not show a spinner (and disable the submit
button?) when they press submit and hide the spinner when that's done ?
It's all about th
Thanks for the replies.
I'm also not sure if doing the validation in the model would work.
Assuming that the user has a slow connection and hits submit on the form
twice, then the first time the email would be unique, so everything
would be good. However, would it not be the case that the secon
If you dont want duplicate data then just add the following to the
model. Thats where validation should be.
validates_uniqueness_of :email_address
On Aug 27, 8:43 am, "Matt W." wrote:
> I have a similar problem that I'm working on, but I was going to take
> a slightly different approach.
>
>
I have a similar problem that I'm working on, but I was going to take
a slightly different approach.
My problem is that I'm collecting completely anonymous data at first,
but then I want people to be able to come in later and create an
account, then hopefully be able to find their records. I'm no
Good to hear that you've solved the problem yourself.
Is now too late to point out that you could probably use
validates_uniqueness_of in your model?
http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002167
--
Posted via http://www.ruby-forum.com/.
--~--~-~--
Thanks for all of the answers.
I solved it a little differently and will explain how in case
a) it helps anybody else
b) there is a flaw in my method which I have overlooked
What I did was in the controller:
Create a model object: @applicant = Applicant.new(params[:applicant])
Wait for a post req
enter just processes the submit button. if you disable the submit
button, then enter key press will be disabled as well. personally, i
would get rid of the submit tag and use a image_submit_tag to get rid
of stupid keyboard annoyances. This will force the user to click on
the link to submit an
Cheers for the reply Fred.
So how would one go about stopping this?
Surely I cannot be the only one with this problem?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
Lee Smith wrote:
> They could have also hit the 'enter' key multiple times too, not
> clicking anything.
>
> But in either case, a small amount of javascript will prevent this.
To prevent the submit button being pressed many times I am using
<%= submit_tag "Submit", :onclick => "this.disabled =
On Wed, Aug 26, 2009 at 10:09 AM, Jim
Burgess wrote:
> I would rather understand what is happening when submit is pressed and
> work things out from there.
You can put a hidden field in your form, detect it and then set a
session variable. Then don't process any more forms when you detect
the ex
I have just finished entering the same data into IE and was rather
surprised to see that I could submit it many times.
So, it seems to be the case that Firefox 3.5 surpresses this behaviour,
whilst IE lets you submit your data as many times as you want.
Do you think it would be possible to stop
On Aug 26, 7:27 pm, Jim Burgess
wrote:
> I have just finished entering the same data into IE and was rather
> surprised to see that I could submit it many times.
> So, it seems to be the case that Firefox 3.5 surpresses this behaviour,
> whilst IE lets you submit your data as many times as you
Jim Burgess wrote:
>> It's the blind leading the blind here,
>
> :-)
>
> It was last night and there was relatively little going on.
> I don't think traffic is the problem.
Well, then it's time to sacrifice a goat.
How long does it take once the button is pressed? Try pressing it once,
then a
They could have also hit the 'enter' key multiple times too, not
clicking anything.
But in either case, a small amount of javascript will prevent this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails:
Is the user who caused the problem friendly or malicious?
If (s)he is (or could be) malicious, then perhaps (s)he didn't use a
browser to create three records in your database, but instead wrote
some code to post three times in quick succession.
I just added a "sleep 5" to my #create method and
On 26 Aug 2009, at 16:02, Jim Burgess wrote:
>
> I have a standard form built with rails, which a user to my site can
> use
> to submit data. Unfortunately one user just managed to submit exactly
> the the same data three times in a row.
>
> From the server logs it seems as though he didn't us
> It's the blind leading the blind here,
:-)
It was last night and there was relatively little going on.
I don't think traffic is the problem.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
No.
I'm at home on my computer, the application is on a web server somewhere
in Germany (as far as I know). I will however try to create the error
from a different computer, see if that works.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You
Jim Burgess wrote:
> No.
> I'm at home on my computer, the application is on a web server somewhere
> in Germany (as far as I know). I will however try to create the error
> from a different computer, see if that works.
Can you reproduce the same kind of traffic surrounding the times when
the
Thanks for the reply.
I am still confused though, as to why I cannot reproduce the error.
When I press submit ten times in quick succession then only one data set
is submitted.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this mes
Jim Burgess wrote:
> I would rather understand what is happening when submit is pressed and
> work things out from there.
In my very limited understanding of the web, this is what happens:
1) data is entered
2) 'submit' is pressed
3) Asynchronous request is sent. If there is a way to make a form
Jim Burgess wrote:
> Thanks for the reply.
> I am still confused though, as to why I cannot reproduce the error.
> When I press submit ten times in quick succession then only one data set
> is submitted.
Are you trying from the server? A computer on the same switch? On the
same subnet? Remember
Quick hit from google after using "disable form rails after click":
http://railsforum.com/viewtopic.php?id=9585
Hope this helps.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Aldric Giacomoni wrote:
> Quick hit from google after using "disable form rails after click":
> http://railsforum.com/viewtopic.php?id=9585
>
> Hope this helps.
Cheers for the reply, but this is quick and dirty and doesn't solve the
problem if the user has javascript disabled.
I would rather u
27 matches
Mail list logo