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:

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 }) %>”>

Hello World

Hope this helps

Cheery-o

Gustav P.
[email protected]

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