Forum: Ruby on Rails 'select' in RJS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
LuCa (Guest)
on 2007-05-06 23:57
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
Phlip (Guest)
on 2007-05-07 00:40
(Received via mailing list)
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
  http://www.oreilly.com/catalog/9780596510657/
  "Test Driven Ajax (on Rails)"
  assert_xpath, assert_javascript, & assert_ajax
LuCa (Guest)
on 2007-05-08 01:33
hmmm, didn't work, although the 'text_field' helper does. I get the
feeling something is wrong with the select statement, suggestions ?

LuCa
This topic is locked and can not be replied to.