Created
July 12, 2010 02:16
-
-
Save andreferraro/472046 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exportação de TODOS os dados no formato xml e json | |
def export | |
@ufs = Uf.find(:all, :order => "uf") | |
prawnto :prawn => {:page_layout => :landscape} | |
respond_to do |format| | |
format.xml { render :xml => @ufs } | |
format.json { render :json => @ufs } | |
format.csv do | |
@output_encoding = 'ISO-8859-1' | |
@filename = "ufs.csv" | |
end | |
format.pdf { render :layout => false, :page_layout => :landscape, :pdf => @ufs, :pdf => @ufs } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment