search_field(object_name, method, options = {})
Instance Public methods
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | search_field( :user , :name ) # => <input id="user_name" name="user[name]" type="search" /> search_field( :user , :name , autosave: false ) # => <input autosave="false" id="user_name" name="user[name]" type="search" /> search_field( :user , :name , results: 3 ) # => <input id="user_name" name="user[name]" results="3" 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" type="search" /> search_field( :user , :name , onsearch: true ) # => <input id="user_name" incremental="true" name="user[name]" onsearch="true" type="search" /> search_field( :user , :name , autosave: false , onsearch: true ) # => <input autosave="false" id="user_name" incremental="true" name="user[name]" onsearch="true" 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" type="search" /> |
Please login to continue.