# Differnece between form\_for and form\_remote\_tag

**URL:** <https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121>\
**Category:** Rails\
**Created:** [March 17, 2008, 7:19am UTC](https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121 "2008-03-17T07:19:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 17, 2008, 7:19am UTC](https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121/1 "2008-03-17T07:19:16Z")

</div>

Hi

Could you please explain the difference between form\_for and  
form\_remote\_tag…On which circumstances they are used?

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 17, 2008, 7:27am UTC](https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121/2 "2008-03-17T07:27:08Z")

</div>

form\_remote\_tag is used for creating a form which will be submitted via  
Ajax.  
Adam

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 17, 2008, 8:08am UTC](https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121/3 "2008-03-17T08:08:02Z")

</div>

There is actually four types of form commands, in two categories:

Model-Backed Forms (forms based on a activerecord object)

Regular Forms (forms not based on a particular object)

and then there are the Ajax and POST variety of each.

So we have:

1. remote\_form\_for (ajax, model-backed) which is used to perform ajax  
actions on a form which is composed of fields relating to a specific  
active record object.

2. form\_for (standard POST, model-backed) which is for performing a  
standard http post on a form which is composed of fields relating to a  
specific active record object.

3. form\_tag (standard POST, not model-backed) which is for performing a  
standard http post on a form which is not model backed and has arbitrary  
input fields.

4. form\_remote\_tag (ajax post, not model-backed) which is for performing  
a ajax post on a form which is not model backed and has arbitrary input  
fields.

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [March 17, 2008, 8:43am UTC](https://www.ruby-forum.com/t/differnece-between-form-for-and-form-remote-tag/132121/4 "2008-03-17T08:43:33Z")

</div>

Hi

thanks for all the replies

Sijo
