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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -