/
_head.html.erb
30 lines (28 loc) · 945 Bytes
/
_head.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<% limit = 10 %>
<div id="search">
<% if prefix -%>
<div class="head">
<form action="<%= path %>" method="get" style="float:left;">
<label for="query"><%= prefix %> search: </label>
<input type="text" name="query" value="<%= @query %>" />
<input type="hidden" name="limit" value="<%= limit %>" />
<% if fuzzy -%>
<input class="button" type="submit" value="similar search" name="fuzzy"/>
<input class="button" type="submit" value="exact search" name="fuzzy"/>
<% else -%>
<input class="button" type="submit" value="search"/>
<% end -%>
</form>
<% if new_path -%>
<form action="<%= new_path %>" method="get" style="float:right;">
<input class="button" type="submit" value="new <%= prefix %> entry"/>
</form>
<% end -%>
<% if delete_path
form_tag delete_path, :method=>"delete", :style=>"float:right;" do %>
<input class="button" type="submit" value="delete"/>
<% end
end -%>
</div>
<% end -%>
</div>