# :with option

**URL:** <https://www.ruby-forum.com/t/with-option/116782>\
**Category:** Rails\
**Created:** [October 9, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/with-option/116782 "2007-10-09T19:38:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [October 9, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/with-option/116782/1 "2007-10-09T19:38:07Z")

</div>

What does the :with option do? Here is the code that I am referencing:

\<% func = remote\_function( :update =\> ‘exclude\_1’, :url =\> {:action =\>  
‘set\_exclude\_airline\_1’, :id =\> @user.id}, :with =\> “‘id=’ +  
escape(value)” ) -%\>

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [October 9, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/with-option/116782/2 "2007-10-09T20:01:46Z")

</div>

> What does the :with option do? Here is the code that I am referencing:
> 
> \<% func = remote\_function( :update =\> ‘exclude\_1’, :url =\> {:action =\>  
> ‘set\_exclude\_airline\_1’, :id =\> @user.id}, :with =\> “‘id=’ +  
> escape(value)” ) -%\>

:with: A JavaScript expression specifying the parameters for the  
XMLHttpRequest. This defaults to value, which in the evaluated context  
refers to the new field value. If you specify a string without a “=”,  
itll  
be extended to mean the form key that the value should be assigned to.  
So  
:with =\> “term” gives “term=value”. If a “=” is present, no extension  
will  
happen.
