This project is archived and is in readonly mode.
in scaffold templates, change paragraph tags to fieldset tags
Reported by charliepark | January 14th, 2009 @ 02:12 PM | in 3.0.2
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.
Comments and changes to this ticket
-
charliepark January 14th, 2009 @ 02:14 PM
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 January 14th, 2009 @ 02:17 PM
(My second post was just to clean up some formatting. I then went back and cleaned up the initial comment.)
-
José Valim January 15th, 2009 @ 09:01 PM
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 January 15th, 2009 @ 10:29 PM
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 January 16th, 2009 @ 03:47 PM
HTML provides the definition list for exactly this scenario. Using dl/dt/dd seems more appropriate than either p or fieldset.
-
joost baaij January 27th, 2009 @ 03:49 PM
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 February 5th, 2009 @ 08:11 PM
- Assigned user set to DHH
-
Mike Breen August 10th, 2009 @ 12:20 AM
- 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 August 10th, 2009 @ 04:17 AM
-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 August 10th, 2009 @ 05:12 AM
-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 August 10th, 2009 @ 10:29 AM
- 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 August 30th, 2009 @ 08:06 PM
(from [5d645c271b350c2a3ed7fd835e539322cda61d8c]) Change scaffold to use _form as partial and div's instead of paragraphs. [#1760 status:resolved] http://github.com/rails/rails/commit/5d645c271b350c2a3ed7fd835e5393...
-
José Valim September 1st, 2009 @ 12:16 PM
- State changed from new to resolved
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1760 in scaffold templates, change paragraph tags to fieldset tags (from [5d645c271b350c2a3ed7fd835e539322cda61d8c]) Change ...
- 1626 fieldWithErrors shouldn't use a div +1 to this and #1760
- 2624 Improve HTML generated by Scaffold See ticket #1760 where these issues are already being dis...