Skip to content

Instantly share code, notes, and snippets.

@captproton
Created August 16, 2012 03:38
Show Gist options
  • Select an option

  • Save captproton/3366362 to your computer and use it in GitHub Desktop.

Select an option

Save captproton/3366362 to your computer and use it in GitHub Desktop.
csv not working
class LeadsController < ApplicationController
# GET /leads
# GET /leads.json
def index
@leads = Lead.all
@csv_leads = @leads.split(",")
respond_to do |format|
format.html # index.html.erb
format.csv { render text: @leads.to_csv }
format.json { render json: @leads }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment