# & in link\_to\_remote... :with =\> "A=1&B=2" becomes &amp;

**URL:** <https://www.ruby-forum.com/t/in-link-to-remote-with-a-1-b-2-becomes-amp/121031>\
**Category:** Rails\
**Created:** [November 22, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/in-link-to-remote-with-a-1-b-2-becomes-amp/121031 "2007-11-22T23:40:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![narozk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@narozk](https://www.ruby-forum.com/u/narozk)\
**Post date:** [November 22, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/in-link-to-remote-with-a-1-b-2-becomes-amp/121031/1 "2007-11-22T23:40:32Z")

</div>

in  
\<%= link\_to\_remote … :with =\>  
%!id=‘img\_name=#{@images\_to\_dsp[i].to\_s}&img\_nr=2’!%\>

becomes

parameters:id=‘img\_name=myimg.jpg&img\_nr=2’

i need & for multiple parameters…

---

<div class="post-metadata">

**Author:** ![narozk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@narozk](https://www.ruby-forum.com/u/narozk)\
**Post date:** [November 23, 2007, 3:53pm UTC](https://www.ruby-forum.com/t/in-link-to-remote-with-a-1-b-2-becomes-amp/121031/2 "2007-11-23T15:53:44Z")

</div>

On Nov 22, 2007, at 5:40 PM, Zoran K. wrote:

> in  
> \<%= link\_to\_remote … :with =\>  
> %!id=‘img\_name=#{@images\_to\_dsp[i].to\_s}&img\_nr=2’!%\>
> 
> becomes
> 
> parameters:id=‘img\_name=myimg.jpg&img\_nr=2’
> 
> i need & for multiple parameters…

Are you saying that this doesn’t work for you? It is the correct  
thing to see even if most browsers relax the rules and let  
“parameters:id=‘img\_name=myimg.jpg&img\_nr=2’” work the same way.  
That’s technically illegal since &img\_nr… isn’t a valid character  
entity.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![narozk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@narozk](https://www.ruby-forum.com/u/narozk)\
**Post date:** [November 23, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/in-link-to-remote-with-a-1-b-2-becomes-amp/121031/3 "2007-11-23T16:07:48Z")

</div>

On 23 Nov 2007, at 14:49, Rob B. wrote:

> > i need & for multiple parameters…
> 
> Are you saying that this doesn’t work for you? It is the correct  
> thing to see even if most browsers relax the rules and let  
> “parameters:id=‘img\_name=myimg.jpg&img\_nr=2’” work the same way.  
> That’s technically illegal since &img\_nr… isn’t a valid character  
> entity.

This being javascript and all, I believe what you actually need to  
produce in terms of js is

parameters: {img\_name: “myimg.jpg” img\_nr: 2}

There are to\_json helpers available to help you on your way.  
Fred
