I am using following statement, but it is not downloading the excel file instead it downloading the normal text file to the browser.
render 'employees/checkin_report', :dates_arr => @dates_arr, :employees => @employees, :content_type => "application/vnd.ms-excel"
I am having checkin_report.xls.erb file, in employees view folder.
If you go to
config/initializers/mime_types.rb
in your project. You'll see something like this.There you can register new MIME types.
I'm sure there are more MIME types you can implement. These are the more common ones.