mysql - Exporting data from Rails into XML and Excel -


i use rubyonrails , want data within database xml or excel format.

how can it?

exporting xml simple, can call to_xml method on items , render result or use render :xml

http://guides.rubyonrails.org/layouts_and_rendering.html#using-render

so example, in controller:

respond_to |format|     format.html     format.xml { render xml: @items } end 

when comes excel, there railscast on exporting csv (which can imported excel) , xls.

http://railscasts.com/episodes/362-exporting-csv-and-excel


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -