1

I installed the comma gem today and everything worked perfectly, but the actual .csv file is empty except for the first cell, which reads:

#<Proc:0x2795700@C:/Ruby192/lib/ruby/gems/1.9.1/gems/comma-0.4.1/lib/comma/render_as_csv.rb:35>

I'm calling comma with this in my controller:

def index
  @registrants = @rsvp.rsvp_registrants

  respond_to do |format|
    format.html
    format.csv { render :csv => @registrants }
  end
end

And keeping it simple in my model for now:

comma do
  email
end

I have tried various other queries, including ones that only return one record, just for troubleshooting purposes. Also installed fasterCSV just now in case it was a dependency.

I'm on Rails 3, Ruby 1.9.2, developing on a Windows XP machine.

Any help is appreciated. Thanks!

1 Answer 1

1

It seems like the latest version of comma(0.4.1) is missing this patch to fix Rails3 rendering support which seems like it would fix the problem you are experiencing.

Try using comma from github instead

gem "comma", :git => "git://github.com/crafterm/comma.git"  
Sign up to request clarification or add additional context in comments.

2 Comments

that line threw an error. Windows issue maybe? Any thoughts? Thanks @Christopher.
@Brett I do believe you need git installed to make this work: help.github.com/win-set-up-git and make sure to select Run Git from the Windows Command Prompt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.