CheckBoxesInput doesn't select/disable correct options #791

Closed
SaschaKonietzke opened this Issue Feb 3, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@SaschaKonietzke

Somehow the make_selected_values and checked?/disabled? methods in Formtastic::Inputs::CheckBoxesInput don't play together anymore. The form element renders, but the previously selected options are no longer selected.

@justinfrench

This comment has been minimized.

Show comment
Hide comment
@justinfrench

justinfrench Feb 6, 2012

Owner

@SaschaKonietzke can you provide me with any more detail about the model, the type of collection, the options you're using on the input method, etc so that I can try to narrow this down and make a test? Also, I assume this is with 2.1.0.beta or master?

Owner

justinfrench commented Feb 6, 2012

@SaschaKonietzke can you provide me with any more detail about the model, the type of collection, the options you're using on the input method, etc so that I can try to narrow this down and make a test? Also, I assume this is with 2.1.0.beta or master?

@SaschaKonietzke

This comment has been minimized.

Show comment
Hide comment
@SaschaKonietzke

SaschaKonietzke Feb 7, 2012

I managed to get this to work. This happened with a MongoMapper model and an embedded to-many-association on the master branch.

It didn't work when I used IDs and a custom collection:

f.input :role_ids, :as => :check_boxes, :collection => [ {'Role Name 1' => BSON::ObjectId('123'} ]

When changing to the association with real objects it is working again:

f.input :roles, :as => :check_boxes, :collection => @available_role_objects

I managed to get this to work. This happened with a MongoMapper model and an embedded to-many-association on the master branch.

It didn't work when I used IDs and a custom collection:

f.input :role_ids, :as => :check_boxes, :collection => [ {'Role Name 1' => BSON::ObjectId('123'} ]

When changing to the association with real objects it is working again:

f.input :roles, :as => :check_boxes, :collection => @available_role_objects

@justinfrench

This comment has been minimized.

Show comment
Hide comment
@justinfrench

justinfrench Feb 7, 2012

Owner

Okay thanks, closing for now, but if there's a change that we need to make or something we can improve, would love to hear about it.

Owner

justinfrench commented Feb 7, 2012

Okay thanks, closing for now, but if there's a change that we need to make or something we can improve, would love to hear about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment