app/helpers/searches_helper.rb
# Return the model to be searched based on params.
Return the model to be searched based on params.
Return the model to be searched based on params .
def search_model
    return "User"       if params[:controller] =~ /home/
    return "ForumPost"  if params[:controller] =~ /forums/
    return "Group"      if params[:controller] =~ /groups/ or params[:action] =~ /groups/
    return "Event"      if params[:controller] =~ /events/
    return "Friendship" if params[:controller] =~ /friends/
    params[:model] || params[:controller].classify
  end
def search_model return "User" if params [ :controller ] =~ / home / return "ForumPost" if params [ :controller ] =~ / forums / return "Group" if params [ :controller ] =~ / groups / or params [ :action ] =~ / groups / return "Event" if params [ :controller ] =~ / events / return "Friendship" if params [ :controller ] =~ / friends / params [ :model ] || params [ :controller ] . classify end
Return the model to be searched based on params.
Return the model to be searched based on params .