ruby on rails - How to return appropriate header for Tire search results? -


if go www.leapfm.com , make search lets "dubstep" return of dubstep songs. however, header still listed "top songs"

i'd instead change search results "dubstep" 5 when search made.

i tried hacky solution didn't work

<% if tire.search.results %> <h6>search results:</h6> <% else %> <h6>top ranked songs</h6> <% end %> 

any ideas?

i'm using this gem

and

here's documentation

the problem more or less making "top songs" header change, , search results returning in index makes difficult.

a simple check against parameters work:

<% if params[:query].present? %>   <h6>search results:</h6> <% else %>   <h6>top ranked songs</h6> <% end %> 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -