-
Couldn't load subscription status.
- Fork 359
Fix for Issue #106. #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Issue #106. #116
Conversation
|
I think it's better if we add an option to If the user pass nothing, the hidden field isn't created. What do you think @burnt43 ? |
|
Speaking only for my use case, I can't think of a time where I'd want either:
Adding the unchecked_value would make it more flexible, but I'm not sure if its necessary. I do not know how others are using collection_check_boxes. It seems awkward to have to adding unchecked_value: "" to my collection_check_boxes when I expected this to be the default behavior. |
|
@burnt43 I agree with you, if this hidden field doesn't exist the changed could not be saved correctly on server side. But, I think we should add an option to accept other value for the hidden field. Can you work on this? |
|
@carloslopes sorry for the late reply, but yes I can work on this. |
|
No problem! :) |
|
@burnt43 @carloslopes I actually ran into this bug for the first time today. I think we should go ahead with @burnt43's original fix and then possibly add the ability to accept a value for the hidden field later. This would also allow me to release a new version of the gem this week... |
|
@carloslopes sounds good. I can work on this later tonight and then hopefully release a new gem as well. |
|
@potenza ok, if you need some help, just ask me! |
|
@carloslopes Thanks! I actually got pulled into something else tonight that I'm still trying to wrap up. Feel like taking care of this one? |
|
Of course! But I will work on it tomorrow, ok? It's 00:15hr here in Brazil
|
|
of course! thanks again. |
|
I started work on this today and I found a problem. The hidden field is generated with the name |
|
@carloslopes I tested these changes locally and it seemed to create the correct hidden field for me: <input id="subscriber_mailing_list_ids" multiple="multiple" name="subscriber[mailing_list_ids][]" type="hidden" value=""> |
|
@potenza yeah, you are right! I removed that My bad! |
when using collection_check_boxes if you select none of the check boxes nothing will update. I've added a hidden field with value "" so if you don't select any check boxes it will update. This is like the behavior for collection_select.