class TissCrawlerController < ApplicationController # self designed lib to call the Tiss API require 'tiss/tiss_crawler' def search # search context like 'People', 'Courses', etc is mandatory $search_context = params[:search_context] # evaluate the proper action regarding to the $search_context case $search_context when 'People' # redirect to people_show_basic, propagate the search_term redirect_to :controller => 'people_crawler', :action => :show_basic, :search_term => params[:search_term] when 'Courses' when 'Theses' when 'Projects' else puts 'Undefined search context' end end def show_basic end def show_detail end def add_to_fav end end