ruby on rails - Active Admin Exporting to CSV file -


i'm using active admin use admin functionalities in rails 4.0 application. have users table lists

  • id
  • name
  • email
  • phone no

i have put button on top of list this.

action_item only: :index   link_to 'export csv', '#' end 

i want export users id name & email csv file when click on button. please me this

just add section inside admin

csv   column :id   column :name   column :email end 

check active admin customize csv

if open link, see line

column(:author) { |post| post.author.full_name } 

it adds authors name post csv file, way can add field want


Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -