Last active
February 16, 2016 12:01
-
-
Save Samuelfaure/e42116389cea17b24e42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def show | |
| @questionnaire_count = Questionnaire.count | |
| @colonnes = Questionnaire.column_names | |
| def calcul_questionnaire | |
| Questionnaire.all.each do |questionnaire| | |
| Questionnaire.columns.map |column| | |
| questionnaire[column.name] | |
| end.join("*") | |
| end | |
| end | |
| end |
This file contains hidden or 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
| - for i in 1..@questionnaire_count | |
| -for j in 1..@colonnes.size | |
| - column = Questionnaire.column_names[j] | |
| - @subtotal = Questionnaire.where(id: i).pluck(:id) | |
| = @total_ligne = @subtotal.to_json + "*" | |
| br |
zaratan
commented
Feb 16, 2016
def show
@questionnaires_to_excel = questionnaires_to_excel
end
def questionnaires_to_excel
Questionnaire.all.each do |questionnaire|
Questionnaire.columns.map do |column|
questionnaire[column.name]
end.join("*")
end
end- @questionnaires_to_excel.each do |questionnaire|
= questionnaire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment