# Validates\_uniqueness\_of

**URL:** <https://www.ruby-forum.com/t/validates-uniqueness-of/160827>\
**Category:** Rails\
**Created:** [February 20, 2009, 4:49am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of/160827 "2009-02-20T04:49:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ishara\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Post date:** [February 20, 2009, 4:49am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of/160827/1 "2009-02-20T04:49:19Z")

</div>

i have a table called requests which save the data of a form.  
but whenever i refresh the browser it again resubmit.it includes  
the following fields

user\_id, arrival, departure, date

this table can include same user\_id, arrival, departure.so that  
i couldn’t use the validates\_uniqueness\_of property. each column  
should be independent of others.can anyone  
suggest me a code which will avoid the resubmittion

---

<div class="post-metadata">

**Author:** ![Ishara\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Post date:** [February 20, 2009, 6:17am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of/160827/2 "2009-02-20T06:17:54Z")

</div>

Ishara G. wrote:

> i have a table called requests which save the data of a form.  
> but whenever i refresh the browser it again resubmit.it includes  
> the following fields
> 
> user\_id, arrival, departure, date
> 
> this table can include same user\_id, arrival, departure.so that  
> i couldn’t use the validates\_uniqueness\_of property. each column  
> should be independent of others.can anyone  
> suggest me a code which will avoid the resubmittion

Which method you are using ? GET or POST ?

---

<div class="post-metadata">

**Author:** ![Ishara\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Post date:** [February 20, 2009, 7:54am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of/160827/3 "2009-02-20T07:54:18Z")

</div>

i use post method,

---

<div class="post-metadata">

**Author:** ![Ishara\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@Ishara\_G](https://www.ruby-forum.com/u/Ishara_G)\
**Post date:** [February 20, 2009, 8:06am UTC](https://www.ruby-forum.com/t/validates-uniqueness-of/160827/4 "2009-02-20T08:06:02Z")

</div>

> can anyone suggest me a code which will avoid the resubmittion

you could just post your code. that way we have at least a chance to  
find the error.
