This project is archived and is in readonly mode.
select tags do not check the :selected option properly
-
Subba
- Assigned user set to Neeraj Singh
-
Subba
adding patch to fix above problem this will coerce the selected , options values to string before comparison.
above problem also happens if the selected is float -
Neeraj Singh
- Milestone set to 3.x
- State changed from new to open
- Tag changed from formbuilder, forms, form_tag_helper to rails 3, formbuilder, forms, form_tag_helper
- Importance changed from to Low
Subba, patch looks good.
Can you write test such that there is no need to escape double quotes. It puts too much of strain. Replace
"<option selected=\"selected\" value=\"1\">first</option>\n<option value=\"2\">second</option>"with
%(<option selected="selected" value="1">first</option>\n<option value="2">second</option>) -
Subba
i am updating tests with above suggestion
-
José Valim
Yo, thanks for the patch! I don't think there is a need to use try. This is in fact causing a bug today, imagine we have [nil] in selected, it will convert nil to string in the selected array, but not the value, because of try.
Also, I think we can convert these values to_s somewhere earlier since they will be converted anyway when we create (so we don't convert them twice). But this is rather secondary.
-
José Valim
Hey guys, any news?
-
Subba
i am updating the patch with jose suggestions.
-
Repository
- State changed from open to resolved
(from [e5163784102e3ce97b99dd50b35b18868dc3c3b5]) Adding missing required statement
[#5056 select tags do not check the :selected option properly state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/e5163784102e3ce97b99dd50b35b18... -
Subba
- Assigned user changed from José Valim to Santiago Pastorino
can you reopen the ticket. commit mention is #5317 missing model require statement in json serialization tests ticket. i used wrong ticket number to create patch. this ticket still in review by jose.
-
Neeraj Singh
- State changed from resolved to open
-
Subba
- Assigned user changed from Santiago Pastorino to José Valim
above patch will no longer with recent changes. i am creating new patch this has less invasive changes than the one above.
-
Repository
- State changed from open to resolved
(from [54477c98482f37d547fa158155ae1624b1f7f7ac]) select tags coerce the :selected option, options to strings before comparison [#5056 select tags do not check the :selected option properly state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/54477c98482f37d547fa158155ae16... -
Repository
(from [dbe5ae488eebee660cd97e59a2e15c4752fbe15b]) select tags coerce the :selected option, options to strings before comparison [#5056 select tags do not check the :selected option properly state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/dbe5ae488eebee660cd97e59a2e15c...
