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