Giter VIP home page Giter VIP logo

active_scaffold_export's Introduction

Active Scaffold Export

An active scaffold addon to let it export data in CSV format

####How to? Easy. First get active scaffold if you haven't yet. Then, add this to your Gemfile:

gem 'active_scaffold_export'

if you're using REE or Ruby 1.8.7, you need to add backports gem as well as fastercsv since REE lacks ruby 1.9 streaming features and fastercsv is in core in 1.9

gem 'backports'
gem 'fastercsv'

Remember to bundle install. Add to application.css:

 *= require active_scaffold_export

Now let's add it to controller, inside active_scaffold config block:

conf.actions.add :export
# you can filter or sort columns if you want
conf.export.columns = %w(name last_name phone address) 
# you can define a default values for the exporting form
conf.export.default_deselected_columns = %w(phone address)
conf.export.default_delimiter = ";"
conf.export.force_quotes = "true"

And enjoy happy exporting :)

Security

It's controlled the same way as Active Scaffold. The extra actions added are:

  • :show_export for the options form
  • :export for retrieving the data Tested with AS internal security and Cancan

Translations

Go in the same active scaffold scope:

active_scaffold:
    columns_for_export: Columnas para exportar
    export_options: Opciones de exportación
    this_page: esta página
    all_pages: todas las páginas 

This gem has not been tested in other rubies than REE and Ruby 1.9. For contact, help, support, comments, please use Active Scaffold official mailing list [email protected]

active_scaffold_export's People

Contributors

vhochstein avatar naaano avatar ewildgoose avatar deinspanjer avatar courtland avatar ananelson avatar lightningdb avatar diedthreetimes avatar mihaijurca avatar

Watchers

Târnovan Ștefan-Gabriel avatar James Cloos avatar Justin McNally avatar  avatar Radu Rosu avatar Marius Ionescu avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.