# How to pass params to button\_to\_remote?

**URL:** <https://www.ruby-forum.com/t/how-to-pass-params-to-button-to-remote/190366>\
**Category:** Rails\
**Created:** [June 18, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/how-to-pass-params-to-button-to-remote/190366 "2010-06-18T15:52:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [June 18, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/how-to-pass-params-to-button-to-remote/190366/1 "2010-06-18T15:52:26Z")

</div>

Hi folks,

I have a form that I populate, and then submit with button\_to\_remote,  
but I would like to have all my fileds that I populated passed as  
parameters (like the params hash) with to my controller. How would you  
do that ?

Reagrds

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [June 18, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/how-to-pass-params-to-button-to-remote/190366/2 "2010-06-18T16:35:29Z")

</div>

Mamadou TourÃ© wrote:

> Hi folks,
> 
> I have a form that I populate, and then submit with button\_to\_remote,  
> but I would like to have all my fileds that I populated passed as  
> parameters (like the params hash) with to my controller. How would you  
> do that ?
> 
> Reagrds

Hi,

button\_to\_remote is having following syntax:

\<%= button\_to\_remote “”, :url =\> {:controller =\>  
“\<controller\_name\>”, :action =\> “\<action\_name\>”, :id =\> ,  
:paramterers =\> “\<parameters\_value\>”}, :html =\> {:style =\> “”, :class =\>  
“”} %\>

If you are trying to submit a form using ajax call, you can try for  
form\_remote\_tag

Might Help,

Saurabh.
