How to generate Excel file with passing params from AJAX sea

I’m performing AJAX search in my Rails application. Here is code from controller:def show@website = Website.find(params[:id])if (current_user.id != @website.user_id) redirect_to root_path flash[:notice]...