blob: eaeac99d836b075a0e4301a756780a387bb55c16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
module SearchHelper
def link_with_search(name, search, html_options = {})
is_current = (@q and search.all? { |k,v| @q.send(k) == v })
if is_current
html_options[:class] = [html_options[:class], "current"].compact.join(" ")
end
link_to name, params.deep_merge("q" => search), html_options
end
end
|