Call rails method from onclick?

I'd like to have the onclick of a form element call a rails method.
Such as:

radio_button :model, :method, 'onclick' => :railsMethod

Otherwise, I'm going to have to do this outside the rails
framework..the old fashioned way hehe.

(I can't get various rjs, observe_field, observe_form, etc attempts to
work...if you'd like to take a stab go right ahead:
http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/68dc8a4a70fc0f32)

krunk- wrote:

I'd like to have the onclick of a form element call a rails method.
Such as:

radio_button :model, :method, 'onclick' => :railsMethod

Otherwise, I'm going to have to do this outside the rails
framework..the old fashioned way hehe.

(I can't get various rjs, observe_field, observe_form, etc attempts to
work...if you'd like to take a stab go right ahead:
http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/68dc8a4a70fc0f32)

>

Hey

You can look at remote_function
Quoted from the RDoc
:

<select id="options" onchange="<%= remote_function(:update => "options",
    :url => { :action => :update_options }) %>">
  <option value="0">Hello</option>
  <option value="1">World</option>
</select>

Hope this helps

Cheery-o

Gustav Paul
gustav@rails.co.za

krunk- wrote:

radio_button :model, :method, 'onclick' => :railsMethod

What about

radio_button :model, :method, :onclick =>
   remote_function(:controller => 'some', :action => 'action')

Eric

Thanks alot! Just what the doctor ordered