Add search link when no results are found on index
parent
484e63f7ee
commit
bf776ce55e
|
@ -7,5 +7,9 @@ module Librarix
|
|||
'default'
|
||||
end
|
||||
end
|
||||
|
||||
def maybe_search?(movies)
|
||||
movies.empty? && params.key?('title')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,3 +17,9 @@ form method="get" action="/" id="filter"
|
|||
|
||||
|
||||
== slim :list, locals: {movies: movies}
|
||||
- if maybe_search?(movies)
|
||||
p
|
||||
| Search for
|
||||
strong
|
||||
a<> href="#{url("/search?search=#{params['title']}")}" = params['title']
|
||||
| ?
|
||||
|
|
Loading…
Reference in New Issue