Hi,
In my view I currently have the following link which show/hides a div
<%= link_to_function “Show Hide” do |page|
page[:user_input_name].toggle
end %>
Instead of using a link to do the show/hiding I would like to use the
onclick event of a checkbox. I understand that I can add javascript to
the onclick event as follows:
<%= form.check_box :io_1 ,{:onclick => “alert(‘Testing’);”}%>
However, is it possible to use rjs code in the onclick part of the
form.check_box?
I know that i can look at the view and grab the javascript generated by
the link and explicitly paste that into the onclick part but I like
using the RJS syntax. Is it possible? e.g. something like:
<%= form.check_box :io_1 ,{:onclick => do |page|
page[:user_input_name].toggle end }%>
Thanks