# Link\_to\_remote multiple :with =\>

**URL:** <https://www.ruby-forum.com/t/link-to-remote-multiple-with/142403>\
**Category:** Rails\
**Created:** [July 7, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/link-to-remote-multiple-with/142403 "2008-07-07T17:01:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 7, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/link-to-remote-multiple-with/142403/1 "2008-07-07T17:01:42Z")

</div>

i have a link to remote and i need to pass two values provided by select  
boxes to it, a language, and a page count (hits per page to be  
paginated) how do i get the code below to send both arguments??

\<%= link\_to\_remote “#{element}”, :update =\> “a\_z\_replace”, :loading =\>  
“Element.show(‘a\_z\_indicator’)”, :loaded =\>  
“Element.hide(‘a\_z\_indicator’)”, :url =\> {:action =\> ‘a\_z\_search’, :ltr  
=\> “#{element}”},

:with =\> “‘a\_z\_language=’+$(‘selectbox’).value &&  
‘page\_count=’+$(‘page\_count’).value” %\>|

Rails 2.0.2, both arguments are individually valid expressions and i can  
get them to do what i want, but i don’t know how to concatenate them  
into a single expression

Thanks,  
Richard

> **[slangasaur.us](http://www.slangasaur.us)**
>
> Slang Words and Phrases,Slang Dictionary

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 7, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/link-to-remote-multiple-with/142403/2 "2008-07-07T17:44:07Z")

</div>

On 7 Jul 2008, at 16:01, Richard S. wrote:

> =\> “#{element}”},
> 
> :with =\> “‘a\_z\_language=’+$(‘selectbox’).value &&  
> ‘page\_count=’+$(‘page\_count’).value” %\>|

Your with fragment should evaluate to a valid query string fragment.  
I’ve got some examples of this at

> **[:with or :without you: link\_to\_remote's mysterious parameter - Space Vatican](https://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter/)**
>
> One of the nice things about Rails is that it makes it really easy to get off the ground with Ajax, thanks to the link\_to\_remote helper (and all the …

Fred
