lib/labelify.rb
# Create a form for a given model object.  Unlike +form_for+ this variant
# automatically includes labels and errors.  The +form_builder+ handles all
# standard form helper methods.  All the field and select sections are decorated
# with a label, except for +hidden_field+.  The <code>:no_label_for</code>
# option can be provide to suppress labels on other methods as well by giving
# a string or regex.
#
# Example:
#   <% labelled_form_for :person, @person, :url => { :action => "update" } do |f| %>
#     <%= f.text_field :first_name %>
#     <%= f.text_field :last_name %>
#     <%= f.text_area :biography %>
#     <%= f.check_box :admin %>
#   <% end %>
#
# Options:
# [<code>:field_class</code>]      extra class name for field element
# [<code>:error_placement</code>]  one of <code>:before_field</code>,
#                                  <code>:after_field</code>,
#                                  <code>:before_label</code>,
#                                  <code>:after_label</code> and
#                                  defaults to
#                                  <code>:inside_label</code>
# [<code>:label_placement</code>]  one of <code>:after_field</code>
#                                  and defaults to
#                                  <code>:before_field</code>
# [<code>:no_label_for</code>]     an array of method names or regular
#                                  expressions not to render a label for
# [<code>:before_field</code>]     text inserted before field element
# [<code>:after_field</code>]      text inserted after field element
Create a form for a given model object.  Unlike +form_for+ this variant
automatically includes labels and errors.  The +form_builder+ handles all
standard form helper methods.  All the field and select sections are decorated
with a label, except for +hidden_field+.  The :no_label_for
option can be provide to suppress labels on other methods as well by giving
a string or regex.




Create a form for a given model object . Unlike + form_for + this variant automatically includes labels and errors . The + form_builder + handles all standard form helper methods . All the field and select sections are decorated with a label except for + hidden_field + . The : no_label_for option can be provide to suppress labels on other methods as well by giving a string or regex .
def labelled_form_for(object_name, *args, &proc) 
    object, options = collect_arguments(object_name, *args, &proc)
    render_base_errors(object)
    form_for(object_name, object, options, &proc)
  end
def labelled_form_for ( object_name , * args , & proc ) object , options = collect_arguments ( object_name , * args , & proc ) render_base_errors ( object ) form_for ( object_name , object , options , & proc ) end
Create a form for a given model object.
Create a form for a given model object .
# :yields: form_builder
object_name
<not_specific>
args
<not_specific>
proc
<not_specific>