Skip to content
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

Add gotcha to RDoc of collection_check_boxes #20548

Merged
merged 1 commit into from
Jun 14, 2015

Conversation

maurogeorge
Copy link
Contributor

The collection_check_boxes generates a default hidden input to prevent a gotcha, like the file_field does.

This PR add a RDoc to this.

# ==== Gotcha
#
# The HTML specification says when nothing is select on a collection of radio buttons
# web browsers do not send any value to server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which spec?

Also, probably:

The HTML specification says that web browsers should not send any value when no selection is made for a collection of radio buttons.

or

When no selection is made for a collection of radio buttons most web browsers will not send any value, based on the HTML specification.

@maurogeorge maurogeorge force-pushed the collection_check_boxes-rdoc-gotcha branch from 00bd317 to a251514 Compare June 13, 2015 19:09
@maurogeorge
Copy link
Contributor Author

@zzak thanks for the review.
I updated the doc following your observations.

@zzak
Copy link
Member

zzak commented Jun 13, 2015

Please wrap it at 80 chars, we may possibly want to consider the following:

From 8.1.2.4 from RFC1866

If none of the elements of a set of radio buttons specifies
`CHECKED', then the user agent must check the first radio button of
the set initially.

@maurogeorge maurogeorge force-pushed the collection_check_boxes-rdoc-gotcha branch from a251514 to 58a75ff Compare June 13, 2015 20:07
@maurogeorge
Copy link
Contributor Author

@zzak I updated to wrap it on 80 chars.

Actually we are adding docs about collection of checkboxes and not radio buttons, yeah on my first commit this was sent as radio buttons, my mistake sorry 😞 .

As you can see on on 8.1.2.3 from RFC1866 we do not have the same doc of the radio buttons. So I rewrote the first paragraph.

This makes senses to you? Or you think we have some RFC that describes this behavior?

@zzak
Copy link
Member

zzak commented Jun 14, 2015

This looks good to me, thanks for your contribution @maurogeorge!

zzak pushed a commit that referenced this pull request Jun 14, 2015
…c-gotcha

Add gotcha to RDoc of collection_check_boxes
@zzak zzak merged commit 88cd09f into rails:master Jun 14, 2015
@maurogeorge
Copy link
Contributor Author

Thanks @zzak for the review and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants