From 65b19c36333cd7220402a1cdcae0c82e462e913e Mon Sep 17 00:00:00 2001 From: Ray Baxter Date: Sun, 17 Jul 2011 12:51:03 -0700 Subject: document options to search_field --- actionpack/lib/action_view/helpers/form_helper.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 3a430abcdf..f18531af97 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -859,7 +859,28 @@ module ActionView InstanceTag.new(object_name, method, self, options.delete(:object)).to_radio_button_tag(tag_value, options) end - # Returns a text_field of type "search". + # Returns an input of type "search" for accessing a specified attribute (identified by +method+) on an object + # assigned to the template (identified by +object+). Inputs of type "search" may be styled differently by + # some browsers + # + # ==== Examples + # + # search_field(:user, :name) + # # => + # search_field(:user, :name, :autosave => false) + # # => + # search_field(:user, :name, :results => 3) + # # => + # # Assume request.host returns "www.example.com" + # search_field(:user, :name, :autosave => true) + # # => + # search_field(:user, :name, :onsearch => true) + # # => + # search_field(:user, :name, :autosave => false, :onsearch => true) + # # => + # search_field(:user, :name, :autosave => true, :onsearch => true) + # # => + def search_field(object_name, method, options = {}) options = options.stringify_keys -- cgit v1.2.3