From 3e0600f27d2b37cb4b6d0acb8851dab5871eb987 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 28 Dec 2007 18:54:07 +0000 Subject: [PATCH] ActionItem135: documenting labelled_form_field --- app/helpers/application_helper.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8c6f48e..3b44447 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -160,8 +160,13 @@ module ApplicationHelper # create a form field structure (as if it were generated with # labelled_form_for), but with a customized control and label. - def labelled_form_field(label, field_html) - NoosferoFormBuilder::output_field(label, field_html) + # + # If +field_id+ is not given, the underlying implementation will try to guess + # it from +field_html+ using a regular expression. In this case, make sure + # that the first ocurrance of id=['"]([^'"]*)['"] in +field_html+ if the one + # you want (i.e. the correct id for the control ) + def labelled_form_field(label, field_html, field_id = nil) + NoosferoFormBuilder::output_field(label, field_html, field_id) end alias_method :display_form_field, :labelled_form_field -- libgit2 0.21.2