This is the companion to my YouTube video: https://youtu.be/MJSZ3WcgHeE
https://guides.rubyonrails.org/debugging_rails_applications.html
- Putting debug info into views using
debug
helper (orto_yaml
orinspect
)
# frozen_string_literal: true | |
require 'csv' | |
class PatientDatum < ApplicationRecord | |
def self.import_from_csv | |
columns = %i[external_id episode_date age_group gender acquisition_info outcome reporter reporter_address reporter_city reporter_postal_code reporter_website reporter_latitude reporter_longitude country region] | |
upsert_columns = %i[episode_date age_group gender acquisition_info outcome reporter reporter_address reporter_city reporter_postal_code reporter_website reporter_latitude reporter_longitude] | |
values = CSV.read(Rails.root.join('data/conposcovidloc.csv'))[1..-1] |
<% content_for :page_header do %> | |
<style> | |
#map { | |
height: 80%; | |
margin-top: 30px; | |
} | |
html, body { | |
height: 100%; | |
margin: 0; | |
padding: 0; |
# frozen_string_literal: true | |
class OntarioController < ApplicationController | |
protect_from_forgery except: :map_data | |
def map_data | |
@patients = PatientDatum.where(region: 'ON').group(:reporter, :reporter_latitude, :reporter_longitude, :reporter_website).count | |
@patient_map = @patients.keys.map do |key| | |
{ | |
'type': 'Feature', |
This is the companion to my YouTube video: https://youtu.be/MJSZ3WcgHeE
https://guides.rubyonrails.org/debugging_rails_applications.html
debug
helper (or to_yaml
or inspect
)PORT=3000 | |
# postgresql | |
POSTGRES_HOST=localhost | |
POSTGRES_PORT=54323 | |
POSTGRES_DBUSER=postgres | |
POSTGRES_PASSWORD=philsmy123 | |
# mysql | |
MYSQL_DBNAME=lotteryportal_development |