# Button\_to\_remote and control values

**URL:** <https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798>\
**Category:** Rails\
**Created:** [July 9, 2009, 1:18pm UTC](https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798 "2009-07-09T13:18:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mistressjanna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Post date:** [July 9, 2009, 1:18pm UTC](https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798/1 "2009-07-09T13:18:33Z")

</div>

I have a partial that has a button\_to\_remote on it wherein a method in  
my controller is appropriately executed. In the same partial, but not  
in any I have a select box with the id of “notesboxselect.”

Is there any way I can pass the text of what is in this select box, to  
the method in my controller called by the button\_to\_remote? Thanks,  
Janna B

Notes: Subrata Chakrabarty Tiger Software India

\<%=button\_to\_remote “Manual Up”,  
:url =\> { :action =\> “manup” },  
:update =\> “insideuplog”  
%\>

---

<div class="post-metadata">

**Author:** ![mistressjanna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Post date:** [July 9, 2009, 3:57pm UTC](https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798/2 "2009-07-09T15:57:05Z")

</div>

On Jul 9, 1:17 pm, JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a partial that has a button\_to\_remote on it wherein a method in  
> my controller is appropriately executed. In the same partial, but not  
> in any I have a select box with the id of “notesboxselect.”
> 
> Is there any way I can pass the text of what is in this select box, to  
> the method in my controller called by the button\_to\_remote? Thanks,  
> Janna B

Sounds like the easiest option here would be the :submit option of  
the various \*\_remote helpers

Fred

---

<div class="post-metadata">

**Author:** ![mistressjanna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Post date:** [July 9, 2009, 4:09pm UTC](https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798/3 "2009-07-09T16:09:23Z")

</div>

On Thu, 2009-07-09 at 04:17 -0700, JannaB wrote:

> Is there any way I can pass the text of what is in this select box, to  
> the method in my controller called by the button\_to\_remote? Thanks,  
> Janna B

button\_to\_remote takes the same options as link\_to\_remote. I believe  
the following will do what you want.

> \<%=button\_to\_remote “Manual Up”,  
> :url =\> { :action =\> “manup” },  
> :submit =\> “notesdiv”

---

<div class="post-metadata">

**Author:** ![mistressjanna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@mistressjanna](https://www.ruby-forum.com/u/mistressjanna)\
**Post date:** [July 9, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/button-to-remote-and-control-values/171798/4 "2009-07-09T16:18:45Z")

</div>

Fred, you are SO the man. How do you KNOW all this stuff??? If I work  
with this for 5 years I won’t know what you know. -Janna B.

On Jul 9, 9:56 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
