search_field_tag(name, value = nil, options = {}) public

Creates a text field of type “search”.

Options

Examples

search_field_tag 'name'
# => <input id="name" name="name" type="search" />

search_field_tag 'search', 'Enter your search query here'
# => <input id="search" name="search" type="search" value="Enter your search query here" />

search_field_tag 'search', nil, class: 'special_input'
# => <input class="special_input" id="search" name="search" type="search" />

search_field_tag 'search', 'Enter your search query here', class: 'special_input', disabled: true
# => <input disabled="disabled" class="special_input" id="search" name="search" type="search" value="Enter your search query here" />
Show source
Register or log in to add new notes.