Skip to content

Instantly share code, notes, and snippets.

@excid3
Last active December 11, 2015 06:18
Show Gist options
  • Save excid3/4558091 to your computer and use it in GitHub Desktop.
Save excid3/4558091 to your computer and use it in GitHub Desktop.
def index
@calls = Call.report(params[:search])
respond_to do |format|
format.html do
@calls.paginate(:per_page => 10, :page => params[:page])
end
format.csv { send_data @calls.to_csv }
format.xls { send_data @calls.to_csv(col_sep: "\t") }
end
end
@acutemedical
Copy link

def index
@Calls = Call.report(params[:search])
respond_to do |format|
format.html do
@Calls = Call.report(params[:search]).paginate(:per_page => 10, :page => params[:page])
end
format.csv { send_data @calls.to_csv }
format.xls { send_data @calls.to_csv(col_sep: "\t") }
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment