app/controllers/activities_controller.rb
def search
    case params[:commit]
      when "Search"
        list
        render :action => 'list'
      when "Export to CSV"
        report
      when "Generate graph"
        graph
        render :action => 'graph'
      else
        redirect_to :action => 'list'
    end
  end
#
# Redirects to list of activitities or graph depending on submit button
# with data specified by search conditions
#

Redirects to list of activitities or graph depending on submit button
with data specified by search conditions
Redirects to list of activitities or graph depending on submit button with data specified by search conditions
def search
    case params[:commit]
      when "Search"
        list
        render :action => 'list'
      when "Export to CSV"
        report
      when "Generate graph"
        graph
        render :action => 'graph'
      else
        redirect_to :action => 'list'
    end
  end
def search case params [ :commit ] when "Search" list render :action => 'list' when "Export to CSV" report when "Generate graph" graph render :action => 'graph' else redirect_to :action => 'list' end end
Redirects to list of activitities or graph depending on submit button
with data specified by search conditions
Redirects to list of activitities or graph depending on submit button with data specified by search conditions