Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10802 (closed enhancement: fixed)

Opened 4 months ago

Last modified 3 months ago

[PATCH] label_tag for form_tag_helper

Reported by: DefV Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords: form_tag_helper verified tiny
Cc:

Description

I've noticed something missing in FormTagHelper while using it. I would have code like:

<label for="login">Login</label>
<%= text_field_tag :login %>

Which kind of felt wrong. I can't use the label() function because that requires two parameters. So in attachment you can find my implementation + tests of label_tag, so you could do

<%= label_tag :login %>
<%= text_field_tag :login %>

Attachments

label_tag.diff (2.5 kB) - added by DefV on 01/14/08 13:45:18.

Change History

01/14/08 13:45:18 changed by DefV

  • attachment label_tag.diff added.

01/14/08 13:49:33 changed by mikel

Looks good to me.

Applies cleanly, test pass +1

01/15/08 16:40:50 changed by bscofield

Works here, too - clean application, and a helpful addition. +1

01/15/08 23:01:43 changed by Radar

Was looking for this over the weekend, I feel it will be helpful +1

01/15/08 23:41:30 changed by DefV

  • keywords changed from form_tag_helper to form_tag_helper verified.

01/15/08 23:42:25 changed by DefV

  • summary changed from label_tag for form_tag_helper to [PATCH] label_tag for form_tag_helper.

01/19/08 20:56:59 changed by DefV

  • keywords changed from form_tag_helper verified to form_tag_helper verified tiny.

01/21/08 21:08:32 changed by nzkoz

  • status changed from new to closed.
  • resolution set to fixed.

(In [8685]) Add label_tag helper for generating elements. Closes #10802 [DefV]

02/10/08 01:04:30 changed by nzkoz

(In [8830]) 2-0-stable: Add label_tag helper for generating elements. References #10802 [DefV]

Merging [8685]