This project is archived and is in readonly mode.
in scaffold templates, change paragraph tags to fieldset tags
-
charliepark
Bah. Let's try that again.
The current scaffold generator templates include paragraph tags
<p>in the forms. A better HTML tag would be the<fieldset>tag.This patch changes the
<p>tags in the New and Edit templates to<fieldset>tags. It also changes the scaffold.css file so that it renders the default template exactly like the current template. -
charliepark
(My second post was just to clean up some formatting. I then went back and cleaned up the initial comment.)
-
José Valim
Quoting Damian Janowski from Rails core group:
"A field set would make sense if you grouped fields like address, zip code and country inside a field set with a legend like "Your location"."
So I'm -1 for this one also.
-
charliepark
Is this the preferred place for discussion? Or at the Rails core e-mail list? Posting this to both.
Clearly, the
<p>tag is the wrong tag. If an input and a label require a wrapping container at all, what options do you have?<p>is for paragraphs of text. That's clearly not what the template is generating here. The other options would seem to be<div>and<fieldset>. I can see your point about fieldsets being for grouping more controls together, rather than an input and a related label, but shouldn't we at least convert that<p>to a<div>? -
Adam Milligan
HTML provides the definition list for exactly this scenario. Using dl/dt/dd seems more appropriate than either p or fieldset.
-
Mislav
+1 for "div.field", "div.actions" and #1626 fieldWithErrors shouldn't use a div
-
joost baaij
Current best practise is to use an OL with each form element in a LI and style at will using CSS.
Barring that +1 for the fieldset as it's the most semantic approach. It gives better context than just a div.
-
DHH
- Assigned user set to DHH
-
Mike Breen
- Tag changed from generator, html, patch, scaffold, templates to bugmash, generator, html, patch, scaffold, templates
-1 on use of fieldset and verified that patch does not apply cleanly to 2-3-stable
-
Dan Croak
-1 this particular patch. Jose's work on generators has been looking good.
verified the patch does not apply cleanly to 2-3-stable.
+1 on a patch from DHH, Jose, or someone in core with a comprehensive vision of better scaffolding. I'd suggest anything that looks like what Formtastic generates, because that gem is great.
Don't want to debate markup semantics, just want Rails to choose a convention (like Formtastic), and make forms faster to write.
-
Elad Meidar
-1 particular patch. verified patch does not apply on 2-3-stable.
Not sure that paragraphs are indeed the "semantic" way to arrange a form, but it's a basic generator output and simple to change.
-
José Valim
- Assigned user changed from DHH to José Valim
- Milestone cleared.
Adam, definition list wouldn't be more appropriated for show?
For new and edit I would agree that ol with li makes more sense. -
Repository
(from [5d645c271b350c2a3ed7fd835e539322cda61d8c]) Change scaffold to use _form as partial and div's instead of paragraphs. [#1760 in scaffold templates, change paragraph tags to fieldset tags status:resolved] http://github.com/rails/rails/commit/5d645c271b350c2a3ed7fd835e5393...
-
José Valim
- State changed from new to resolved
