Yo quiero que en el evento onChange del select ejecute una funcion
ajax que me actualiza otra parte de la pantalla.
Quiero algo parecido a este ejemplo...pero que funcione con un select
<table>
<% for email in @emails %>
<tr ondblclick="<%= remote_function(:update => 'email_body',
:url => {:action => 'get_email',
:id => email})">
<td><%= email.id %></td><td><%= email.body %></td>
</tr>
<% end %>
</table>
<div id="email_body" />
Como le agrego la llamada de remote_function a
<%= collection_select(:category, :id, @all_categories, :id, :long_name) %>
Muchas gracias
Pablo R
On 3/16/07, nelson fernandez <[EMAIL PROTECTED]> wrote:
> para eso no haria falta llegar a ajax..... el SELECT tiene un evento
> javascript llamando onChange.....
>
> --
> :: nelson ::
> artesano de software
> http://netflux.com.ar
>
>
> On 3/16/07, Pablo Rodriguez <[EMAIL PROTECTED]> wrote:
> > Hola
> > Estoy siguiendo un ejemplo de un libro de RoR
> >
> > <label for="category_id">Filter "Unused Photos" on this
> > Category</label><br/>
> > <%= collection_select(:category, :id, @all_categories, :id, :long_name) %>
> >
> > <%= observe_field(:category_id,
> > :frequency => 0.5,
> > :update => 'slideshow-photos',
> > :url => { :action => 'change_filter'},
> > :with => 'category_id' ) %>
> > </p>
> >
> > Tengo una lista, y defino un observer_field sobre esa lista, para que
> > cada medio segundo valide si cambio ese valor.
> > Lo que quiero es que cada vez que cambia el valor de la lista se
> > dispare el evento , no que valide cada 0.5 seg.
> > Como hago para agregar ese fire event al "collection_select",
> > @all_categories es una lista de objetos Categories que tiene la
> > propiedad :id y :long_name.
> >
> > Se entiende ?
> >
> > Saludos
> > Pablo Rodriguez
> > --
> > Pablo Rodrigueez
> > _______________________________________________
> > ruby mailing list
> > [email protected]
> > http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
> >
> _______________________________________________
> ruby mailing list
> [email protected]
> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>
--
Pablo Rodrigueez
_______________________________________________
ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar