Commit 3e0600f27d2b37cb4b6d0acb8851dab5871eb987

Authored by AntonioTerceiro
1 parent 3f6a94be

ActionItem135: documenting labelled_form_field



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1155 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 7 additions and 2 deletions   Show diff stats
app/helpers/application_helper.rb
... ... @@ -160,8 +160,13 @@ module ApplicationHelper
160 160  
161 161 # create a form field structure (as if it were generated with
162 162 # labelled_form_for), but with a customized control and label.
163   - def labelled_form_field(label, field_html)
164   - NoosferoFormBuilder::output_field(label, field_html)
  163 + #
  164 + # If +field_id+ is not given, the underlying implementation will try to guess
  165 + # it from +field_html+ using a regular expression. In this case, make sure
  166 + # that the first ocurrance of id=['"]([^'"]*)['"] in +field_html+ if the one
  167 + # you want (i.e. the correct id for the control )
  168 + def labelled_form_field(label, field_html, field_id = nil)
  169 + NoosferoFormBuilder::output_field(label, field_html, field_id)
165 170 end
166 171 alias_method :display_form_field, :labelled_form_field
167 172  
... ...