Check_box_tag call action on change (AJAX)

Hi all,
I’m developing an application with Rails 3.0.9 and I have a checkbox
and I want to call a function when it is checked/uchecked.
I’m trying with:
<%= check_box_tag “mylabel” t.to_s, false, { :onchange =>
remote_function( :url => { :action => ‘update_preview’, :id =>
t.to_s })} %>

in the “show” view and this in the controller

def update_preview
puts “-> hey!!!”
end

But the update_preview isn’t called
Someone can help me to understand?

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs