Created
November 25, 2012 16:29
-
-
Save universal/4144241 to your computer and use it in GitHub Desktop.
custom table rows for active admin
This file contains 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
ActiveAdmin.register Questionnaire do | |
index do | |
column :id do |questionnaire| | |
link_to questionnaire.id, admin_questionnaire_path(questionnaire) | |
end | |
column :title do |questionnaire| | |
link_to questionnaire.title, admin_questionnaire_path(questionnaire) | |
end | |
column :csv_export do |questionnaire| | |
link_to "CSV Export", csv_export_admin_questionnaire_path(questionnaire, :format => :csv) | |
end | |
end | |
member_action :csv_export, :method => :get do | |
questionnaire = Questionnaire.find(params[:id]) | |
send_data questionnaire.to_csv, :type => "text/csv", :disposition => 'attachment' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment