similar to: setting header in views?

Displaying 20 results from an estimated 1000 matches similar to: "setting header in views?"

2007 Feb 26
2
Problem concerning CSV Mime Type
Hello, I have an application that should be able to export a list of users as CSV. So I put Mime::Type.register "text/csv", :csv into my environment.rb, and added this code to my UserController''s index action: format.csv do require ''csv'' CSV::Writer.generate(csv_string = "", '','') do |csv| csv
2008 Feb 11
0
send_data problem
Hi! Following call for sending data does not sets the HTTP Content-Type header under Rails 2.02: send_data(csv_string,:filename => @entity.name+".csv", :type => ''text/ csv; charset=UTF-8'') Can anyone help why its happening? Regards, Mohsin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2008 Oct 27
8
why can't johnny download?
I''m working on an app that includes the feature to allow user to download a csv file of their data. I''ve got it working on my local machine, but when I deploy it, the link I''m making doesn''t work for doing the download. The file IS being created in the location I''m intending, but the file download only works on my local machine and not on the server.
2009 Jun 17
12
FasterCVS and Rails
Hello all, I''m trying to import some csv data (that has latin characters) using faster csv but I keep getting a MalformedCSVError: "Unclosed quoted field on line 1." "/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1592:in `shift''" I''ve tested the same code outside of the Rails application an it works fine. Can anyone help me? Here is
2006 May 17
6
newbie wants to know..FasterCSV or just CSV?
I''m trying to grab a CSV file from a user and let them upload it directly to my database, but doing some minor checks on the data before saving. Which is the easier way to implement this? CSV or FasterCSV? I saw that perhaps there were some issues with FasterCSV and csv files created from Mac versions of Excel. Anyone have any experience with this and can recommend a newbie friendly
2006 Aug 16
2
installing fastercsv into vendor directory
I am using fastercsv to process input files. I want to install it into my app/vendor directory as a gem (I guess). I used ''rake rails:freeze:gems'' to get rails into the vender dir. But I cannot find any doc on how to do it for fastercsv or any third-party gem. Any help appreciated. -- Posted via http://www.ruby-forum.com/.
2009 Feb 09
9
fastercsv, freezing into vendor/gems
I''m using fastercsv such that in my rake file I''m doing this. require ''fastercsv'' It works fine on my Mac. I need to freeze this gem into the app though so my rake tasks work on the production machine. ----------- I spent about two hours though this weekend trying to get this Gem "frozen" into the vendor/gems folder. I tried all sorts, I ... -
2008 May 01
1
Strategy for importing temporary .csv file?
For some reason, I''ve posted this question to this forum 4 times now and it never appears in the daily consolidated email I get daily? I''ve written a routine allowing the client user to declare where their .csv import file resides and then send it to the server to import the many rows into an existing model table, and then throw it away. I''ve imported many graphic files
2010 Apr 29
2
send_data => invalid byte sequence in US-ASCII
I''m trying to display a generated .png plot via send_data(), but it results in a server error "invalid byte sequence in US-ASCII" error. I''m pretty sure this means that I need to specify the encoding somewhere, but I haven''t been able to figure out where or how to do so. Some particulars: I''m running gnuplot through a pipe to generate a plot in .png
2008 Feb 07
6
Buffer flushing
Short question: is there way to tell EM to actually send data after send_data call? I''m building a file transferring app. I send Mashal.dump''ed metadata first, and then - the file contents (chunked). I found a silly bug: receive_data() gets marshalled metadata and the first chunk of the file in a single variable. Like that: c1.send_data("meta")
2008 Jul 18
4
gem question on hosted service
All, This may be a gem question (not rails) but I feel sure someone else on this list has seen this issue go by. I use a hosting service that has ROR available, but I am among the few developers using it. I am developing on a local linux box, and have been very careful to NOT use any extra gems because I might have a problem with my provider. Well ... fastercsv rocks and I wanted to use it. My
2006 Mar 21
8
Loading the contents of a CSV file to a database
Hello Everybody, I picked up on the buzz about RoR and wanted to see what the fuss is about. So far i am very impressed but have hit a bit of a wall with a little play app i am writting. I want to iterate through a CSV file of my bank transactions and see just how much money i spend on beer and pies every month. I have successfully setup a database with a single table called transactions
2008 Jan 06
5
Having very odd problems with UDP.
I am using eventmachine 0.8.1 on windows XP and am having very odd problems. This snippet of code gives the error that follows it. class EchoServer def receive_data data puts data send_data ">>>you sent: #{data}" if data =~ /quit/i puts "quitting" close_connection EventMachine::stop_event_loop end end end
2007 Jul 25
3
FasterCSV load file to table
Hello Guys, May be it is simply but any way.... fasterCSV 1.2.0 how to load data from file to table :( I have tried this: file has just one line 1,2,3 data = FCSV.read("C:\\temp_file.csv") table = FCSV.parse(data, :headers => true) puts "data overview" puts data puts "table overview" puts table but got very strange error: undefined method
2011 Mar 26
2
upload file, read first 10 lines.
I have a csv file and in my controller: uploaded_file = params[:upload][:csv].read @rows << FasterCSV.parse(uploaded_file) I want to put in @rows only the first 10 lines but the read method reads all the file. How can I do? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Jul 29
1
Debian - plugins being installed to the wrong place?
Hi, I''ve been moving my app from my development environment (my laptop running OSX) to my test environment (a dedicated Debian box in a datacentre somewhere). All seems to be OK except ruby Plugins don''t seem to work. When I go to a page which uses a plugin I get errors... e.g. uninitialized constant Paypal Same happens with other plugins I''m using e.g. FasterCSV
2005 Mar 08
3
Extracting images from a DB
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I would like to extract an image BLOB from my database and display it alongside some other information on my ''edit'' page. I read the information here http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles and that was really helpful. However, it still isn''t clear to me how I would get access to the image in my views if
2006 Jan 09
6
Rendering dynamic Gruff image (send_data)
Dears, Got a controller witch do a send_data for displaying a chart. like : send_data(g.to_blob, :filename => "any.png", :type => ''image/png'', :disposition=> ''inline'') I actually do a <img src="http://myhost:3000/stats/make_graph" /> Is there any way more clean to do that ? At minima don''t hardcode the beginning
2006 Jan 04
4
How to open a pdf file in new window
Hi all I made a pdf file in ruby and to display it used the method send_data like # send_data pdf.render, :filename => "Hello.pdf",:type => "application/pdf" # Now I want to open it in another window or as a popup. How can I achieve it? Thanks to all. Sainaba. -- Posted via http://www.ruby-forum.com/.
2009 Aug 05
1
How do I use fastercsv to just read the header row and not the whole file?
How do I use fastercsv to just read the header row and not the whole file? I need to read the header row first and not the whole csv file initially in the web application so I can map the input csv columns to the db columns. Once the mapping is complete, a rake task will than process the whole file. I don’t want to read the whole file to save processing time. How do I just read the header row