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

Ticket #10085: auto_complete_text_field_with_auto_complete-documentation.patch

File auto_complete_text_field_with_auto_complete-documentation.patch, 1.7 kB (added by ceefour, 8 months ago)

Documentation fix/patch for auto_complete plugin.

  • a/auto_complete/lib/auto_complete_macros_helper.rb

    old new  
    102102  # Wrapper for text_field with added AJAX autocompletion functionality. 
    103103  # 
    104104  # In your controller, you'll need to define an action called 
    105   # auto_complete_for to respond the AJAX calls, 
     105  # auto_complete_for to respond the AJAX calls. 
     106  # 
     107  # Note that by default, this helper will output a stylesheet inline, which 
     108  # will make your HTML markup invalid. To do this cleanly, add: 
     109  # 
     110  #   <%= auto_complete_stylesheet %> 
     111  # 
     112  # inside your page's or layout's HEAD element, which will output the 
     113  # default stylesheet from the auto_complete plugin. (you may also customize 
     114  # the stylesheet as you wish, refer to the generated stylesheet as 
     115  # a reference) 
     116  # 
     117  # After including the stylesheet into the HEAD element, you can skip inclusion 
     118  # of stylesheet in the text_field itself by using <tt>:skip_style => true</tt> 
     119  # in the +completion_options+ argument. 
     120  # 
     121  # Example usage: 
     122  # 
     123  #   <%= text_field_with_auto_complete :person, :name, 
     124  #     {:class => 'searchField'}, {:skip_style => true} %> 
    106125  #  
     126  # Note the two options (+tag_options+ and +completion_options+) are separate, 
     127  # thus you need to use the options within two separate hashes. 
    107128  def text_field_with_auto_complete(object, method, tag_options = {}, completion_options = {}) 
    108129    (completion_options[:skip_style] ? "" : auto_complete_stylesheet) + 
    109130    text_field(object, method, tag_options) +