Ruby on Rails
Wednesday, August 10, 2016
Liz
On Monday, August 8, 2016 at 4:40:21 PM UTC-4, Liz Huang wrote:
On Monday, August 8, 2016 at 4:40:21 PM UTC-4, Liz Huang wrote:
THe part of code is:def downloadCSVrequire 'csv'@ary = session[:ary]csv_string= CSV.generate do |csv|@ary.each do |t|csv << [t]endendsend_data csv_string,type: 'text/csv; charset=iso-8859-1; header=present',disposition: 'attachment', filename: 'rannumgenerator.csv'endThe web applet link is:You can enter 1000 for N and 13 for C, click compute, get a result page,which hasthe code above is used for downloading CSV file after click CSV, which worksin rails 4.2.0, now instead of showing the download dialog, all numbers displayedin the page.Thanks!Liz
On Monday, August 8, 2016 at 4:15:44 PM UTC-4, Colin Law wrote:On 8 August 2016 at 19:25, Liz Huang <liyhu...@gmail.com> wrote:
>
>
> Hi,
>
> Recently I just upgrade rails from 4.2.0 to 5.0.0, wonder what I need to do
> to
> make send_data downloadable file working again? Now the data displayed in
> page instead of downloadable file as before?
You need to post the bit of code that is failing so we can see what
you are doing. We are not telepathic. Not large chunks of code just
the bit that is failing. Tell us what you expect that bit of code to
do and what it actually does.
Colin
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/978f2967-2d6b-4e59-aa1b-bd8a7d705fe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment