method
search_field
v3.2.13 -
Show latest stable
-
0 notes -
Class: ActionView::Helpers::FormHelper
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (0)
- 3.1.0 (38)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-3)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
search_field(object_name, method, options = {})
public
Returns an input of type “search” for accessing a specified attribute (identified by method) on an object assigned to the template (identified by object_name). Inputs of type “search” may be styled differently by some browsers.
Examples
search_field(:user, :name) # => <input id="user_name" name="user[name]" size="30" type="search" /> search_field(:user, :name, :autosave => false) # => <input autosave="false" id="user_name" name="user[name]" size="30" type="search" /> search_field(:user, :name, :results => 3) # => <input id="user_name" name="user[name]" results="3" size="30" type="search" /> # Assume request.host returns "www.example.com" search_field(:user, :name, :autosave => true) # => <input autosave="com.example.www" id="user_name" name="user[name]" results="10" size="30" type="search" /> search_field(:user, :name, :onsearch => true) # => <input id="user_name" incremental="true" name="user[name]" onsearch="true" size="30" type="search" /> search_field(:user, :name, :autosave => false, :onsearch => true) # => <input autosave="false" id="user_name" incremental="true" name="user[name]" onsearch="true" size="30" type="search" /> search_field(:user, :name, :autosave => true, :onsearch => true) # => <input autosave="com.example.www" id="user_name" incremental="true" name="user[name]" onsearch="true" results="10" size="30" type="search" />