Class: Marsdawn::Site::SearchBox
- Inherits:
-
Object
- Object
- Marsdawn::Site::SearchBox
- Defined in:
- lib/marsdawn/site/search_box.rb
Instance Method Summary collapse
-
#initialize(site, word) ⇒ SearchBox
constructor
A new instance of SearchBox.
- #to_html ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(site, word) ⇒ SearchBox
Returns a new instance of SearchBox.
6 7 8 9 |
# File 'lib/marsdawn/site/search_box.rb', line 6 def initialize site, word @site = site @word = word end |
Instance Method Details
#to_html ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/marsdawn/site/search_box.rb', line 15 def to_html if @site.searchable? %|<div id="search-box"> <form action="#{@site.search_path}" method="get"> <input type="search" name="search" value="#{Marsdawn::Util.html_escape(@word)}" /> </form> </div>| end end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/marsdawn/site/search_box.rb', line 11 def to_s to_html end |