justinfrench/formtastic — Issue #747: Cannot clear HABTM relationship
Author: TimFletcher
Created: 2011-11-24 23:57:27+00:00
State: open

I'm using formtastic via active_admin but I think this issue lies within formtastic.

I can't get a multiselect to clear on save. It seems it doesn't POST anything at all when there's nothing selected. I believe it should POST the appropriate key with a blank value. If I change the field to use checkboxes, it works because a blank value is posted though properly within the hash. My code is:

ActiveAdmin.register Organization do
form do |f|
f.inputs "Details" do
f.input :name
f.input :provinces, :as => :check_boxes # multi-select, can be cleared
f.input :provinces # select, cannot be cleared
end
end
end

I couldn't find anything in the docs so sorry if I'm just missing something obvious and this isn't an issue at all.