Displaying 20 results from an estimated 1000 matches similar to: "CSV Upload Issue"
2010 Dec 20
1
Writing to a CSV with Faster::CSV
Is there a way to write a csv file using a hash instead of an array?
Something like this:
header_keys = :first_name, :last_name, :email
FasterCSV.open("path/to/file.csv", "w") do |csv|
User.all.do |user|
csv << user
end
end
Thanks...
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2010 Dec 27
5
Is apostrophe (') something special in a regex if at end?
(Ruby 1.9.2) I have a simple validation regex which I need to pass the
following values: "Billy-Bob" and "O''Kelley" (as test cases). Originally I
was not allowing apostrophe but it became apparent I had to allow it.
The initial regex was:
/^[a-zA-Z -]*$/
Now, when I added the apostrophe like this:
/^[a-zA-Z'' -'']*$/
Then for some reason
2011 Sep 30
1
ubygems.rb file - is error?
Hi, I just installed Rails, and I was wondering what is this file?
/lib/ubygems.rb ?
Here is a copy of it:
https://github.com/rubygems/rubygems/blob/master/lib/ubygems.rb
Is this a bug/type (ubygems rather than what it should be, ubygems) or
is it supposed to be that way? If so, what does it do, could someone
explain how it works? (sorry if it''s a dumb question I''m new at
2011 Oct 04
9
Postgresql adapter not working
Hello everyone. I''m starting with Rails going through the obvious
"Getting Started with Rails" guide:
http://guides.rubyonrails.org/getting_started.html
Everything goes smoothly until the rake db:create command, which
returns this strange error message referring to a gem that apparently
doesn''t exist:
Please install the postgresql adapter: `gem install activerecord-
2010 Jul 02
22
MySQL not Connected ...... *pull hair*
I''m trying to run " rake db:migrate " and im getting an error back:
------------------------------------------------------------------------
C:\wamp\www\demoproject>rake db:migrate
(in C:/wamp/www/demoproject)
rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations`
(`version`
varchar(255) NOT NULL) ENGINE=InnoDB
(See full trace by running task
2010 Dec 01
6
Mongrel, .htaccess, cpanel, rewrite, Mongrel::HttpParserError
I just installed my RoR application on my ISP''s server.
This is a Cpanel environment and it creates a .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^xyz.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.xyz.com$
RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12001\/$1" [P,L]
in a public_html directory. (I changed my domain name in the text above
to xyz because we are
2010 Aug 13
11
Link to remote and the equivalent in Rails 3
Hi
WOW! Is Rails 3 another interesting learning curve. Just when I think
I have a general working knowledge of Rails 2 ... things change.
I''m trying to replicate the following in Rails 3:
<%= link_to_remote image_tag("creditcard.png", :border => 0), :url =>
{:action => :make_payment, :type => "Credit", :id =>
@appt.id },
2010 Nov 22
6
Should be obvious, but how do I even know what versions of ruby are available for rvm to use with rvm install?
I''m getting back to learning rails and at one point I used rvm to install
some rubies. Now I''m playing dumb and want to install the latest ruby
version - latest beta. How in the world do I found out the name of it? I''d
think it would be named somewhere here
http://www.ruby-lang.org/en/downloads/ and then I could just do rvm install
ruby-XYZ. I don''t get where I
2011 Apr 19
1
RSpec/Webrat Checking output is properly escaped
I want to test that the JSON response from a create action is
sanitized properly, but rspec or webrat appears to be parsing the
output into proper HTML chars instead of escaped characters. I have
verified that it escapes properly in the regular browser json
response.
The relevant RSpec test code is:
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
it
2006 Mar 29
4
Why doesn''t Rails 1.1 have all the Script.aculo.us 1.6 files?
Why aren''t builder.js, slider.js, and scriptaculous.js part of the
Rails 1.1 javascripts?
rab:javascripts $ pwd
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.0/html/javascripts
rab:javascripts $ ls -l
total 288
-rw-r--r-- 1 root wheel 148 Mar 28 08:56 application.js
-rw-r--r-- 1 root wheel 28036 Mar 28 08:56 controls.js
-rw-r--r-- 1 root wheel 23613 Mar 28 08:56 dragdrop.js
2011 Jun 17
7
Encoding
What''s a good solution for fixing character encoding problems for
compatibility between ascii and utf-8? The database is postgres and
is encoded in utf-8.
Once in awhile there will be a compatibility error from strings from a
webform.
Is there a command to fix this besides using
a_string.force_encoding(''utf-8'')? Even this doesn''t seem to always
work either.
2011 Oct 26
6
Add an index to a form
Hello,
I''m having some trouble with forms, my app allows to enter data by
using a multi-step form that has 7 steps.
There are 3 steps that may let the user to add 1 form, for example
there''s a step called "children"
and that children has the following fields:
* name
* age
* gender
but one father may have more than 1 child and I''m adding another form
with
2009 Apr 03
1
How to find out image width and height which is saved in database?
How to find out image width and height which is saved in database,
with out using any applications or addons Please help
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe
2009 Jun 13
3
How Can I insert another column data into the CSV file when I use FasterCSV?
Hi, All,
Suppose I have a CSV file, there is data in it.
* Column 1 Column2 Column 3 Column 4
Row1 a b c
Row2 a2 b2 c2*
You know, the column 4 is no data
Now, I would like to insert data to Column 4, after save, the CSV file will
be:
* Column 1
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
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
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 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 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/.
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