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
| # frozen_string_literal: true | |
| require 'optparse' | |
| # Need to gem install those | |
| require 'ruby-progressbar' | |
| require 'colorize' | |
| # Nice-to-have | |
| class Integer |
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 create | |
| Compliment.create compliment_params | |
| redirect_to '/compliments/index' | |
| 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
| // Code for radio buttons | |
| $(document).ready(function(){ | |
| $(".radio_button_change").on("change", function(){ | |
| $("#disappear").toggle($(this).hasClass("radio_button_open")); | |
| }); | |
| }); | |
| $(document).ready(function(){ | |
| $(".radio_button_change_trouble").on("change", function(){ | |
| $("#disappear_trouble").toggle($(this).hasClass("radio_button_open_trouble")); |
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 |
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
| class ApplicationController < ActionController::Base | |
| # Prevent CSRF attacks by raising an exception. | |
| # For APIs, you may want to use :null_session instead. | |
| protect_from_forgery with: :exception | |
| before_action :set_cookies | |
| private | |
| def set_cookies | |
| if !cookies.permanent[:token] |