vhochstein / active_scaffold

Rails 4 Version of activescaffold supporting jquery
MIT License
156 stars 34 forks source link

update columns for checkbox input #136

Closed clyfe closed 13 years ago

clyfe commented 13 years ago

When using the update_columns feature:

conf.columns[:foo] = :bar

when :foo is a check-box the same value is sent no matter if the check-box is checked or not. When the check-box is checked the value should be sent and when it's unchecked nothing should be sent.

vhochstein commented 13 years ago

Works for me.... GET "/doping_tests/render_field?column=result&id=1&update_columns[]=tested_at&value=&source_id=record_result_1" GET "/doping_tests/render_field?column=result&id=1&update_columns[]=tested_at&value=1&source_id=record_result_1

vhochstein commented 13 years ago

Any news concerning this issue. My environment: firefox 3.x and rails 3.0.5 What about your environment?

clyfe commented 13 years ago

I am rails 3.0.7, AS 3.0.19, Chromium 10.0 browser, jQuery Sample app https://github.com/clyfe/as_bugs see README

2 XHR finished loading: "http://localhost:3000/roles/render_field?column=is_admin&update_columns[]=what_he_is&value=1&source_id=record_is_admin_".
vhochstein commented 13 years ago

All action_links are not opened inline. Do you have the same behaviour on your site?

clyfe commented 13 years ago

Yes, that too! (in the as_bugs app, in my other private app action links work ok)

vhochstein commented 13 years ago

Your whole javascript is nt working please upgrade to jquery 1.4.4. 1.4.1 is nt working

clyfe commented 13 years ago

I upgraded, now the action links work, but the update_columns is still the same

2 XHR finished loading: "http://localhost:3000/roles/render_field?column=is_admin&update_columns[]=what_he_is&value=1&source_id=record_is_admin_".
vhochstein commented 13 years ago

Apart from that I was able to reproduce your issue, but I ve got no idea so far why it isnt working.

vhochstein commented 13 years ago

Finally find some time to take a detailled look.. Seems that code did not work with all jquery versions.. Hope that my last commit fixed your issue.