# Action call with a csv, but render html with flash

**URL:** <https://www.ruby-forum.com/t/action-call-with-a-csv-but-render-html-with-flash/192090>\
**Category:** Rails\
**Created:** [July 23, 2010, 4:41pm UTC](https://www.ruby-forum.com/t/action-call-with-a-csv-but-render-html-with-flash/192090 "2010-07-23T16:41:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [July 23, 2010, 4:41pm UTC](https://www.ruby-forum.com/t/action-call-with-a-csv-but-render-html-with-flash/192090/1 "2010-07-23T16:41:52Z")

</div>

Does anyone know how to get an action call with csv to render html  
with flash? I can get it to work locally but when I upload to the  
server it keeps trying to render a csv file with the html inside it.

unless flash[:error].blank?  
render :template =\> ‘/report/action’ and return  
@content\_type = ‘text/html’  
respond\_to do |format|  
format.html  
end  
else  
respond\_to do |format|  
format.html  
format.csv { render :layout =\> false }  
end  
end
