# 'select' in RJS

**URL:** <https://www.ruby-forum.com/t/select-in-rjs/103483>\
**Category:** Rails\
**Created:** [May 6, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/select-in-rjs/103483 "2007-05-06T21:57:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@luca](https://www.ruby-forum.com/u/luca)\
**Post date:** [May 6, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/select-in-rjs/103483/1 "2007-05-06T21:57:25Z")

</div>

Hi All

I just tried (in a .rjs file)

page[:noq].innerHTML = select(“post”, “person”, 1.upto(10) {|p| [p, p]  
} )

It didn’t work. I also included the ‘select’ helper in the controller,  
but that didn’t help. I have to add that all this works when using HTML  
instead of the select helper!

Any suggestion what I do wrong in this select call.

Thnx  
LuCa

---

<div class="post-metadata">

**Author:** ![luca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@luca](https://www.ruby-forum.com/u/luca)\
**Post date:** [May 6, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/select-in-rjs/103483/2 "2007-05-06T22:40:20Z")

</div>

LuCa wrote:

> page[:noq].innerHTML = select(“post”, “person”, 1.upto(10) {|p| [p, p]

You probably mean page.replace\_html :noq, select…

If that doesn’t work, try :inline =\> “\<%= select… %\>”

–  
Phlip  
[Test Driven Ajax (on Rails) [Book]](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

**Author:** ![luca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/51bf81/32.png) [@luca](https://www.ruby-forum.com/u/luca)\
**Post date:** [May 7, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/select-in-rjs/103483/3 "2007-05-07T23:33:21Z")

</div>

hmmm, didn’t work, although the ‘text\_field’ helper does. I get the  
feeling something is wrong with the select statement, suggestions ?

LuCa
