How to Make CSV Format Report of User Information using Active Scaffold in Rails 2.3.8

余生颓废 提交于 2019-12-11 15:59:38

问题


I am New Ruby on Rails. I want to export CSV File for User Information which is having user controller.

Ruby version: 1.8.7 Rails version: 2.3.8

Example:

I have user controller:

    class Admin::UserController < ApplicationController
          active_scaffold :users do |config|
                 config.list.sorting = {:name => :asc}

                 config.columns[:name].form_ui=:text_input
                 config.columns[:name].inplace_edit=true

                 config.columns[:email].form_ui=:text_input
                 config.columns[:email].inplace_edit=true

                 config.columns[:phone].form_ui=:text_input
                 config.columns[:phone].inplace_edi=true

          end
    end

Model: user

    class User < ActiveRecord::Base
    end

I want to export file as CSV the above details which having my user controller. is this any requirement for doing this? please anybody can guide me.


回答1:


You're looking for the ActiveScaffold Export plugin:

http://code.google.com/p/activescaffoldexport/wiki/Features

https://github.com/ewildgoose/active_scaffold_export



来源:https://stackoverflow.com/questions/6994251/how-to-make-csv-format-report-of-user-information-using-active-scaffold-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!