A step-by-step guide on how codr.academy was built
rails new codr.academy -d postgresql
Update config/database.yml
default: &default
host: localhost
port: 5432
username: <%= Rails.application.credentials.dig(:db, :username) %>
password: <%= Rails.application.credentials.dig(:db, :password) %>
EDITOR="nano" rails credentials:edit
db:
username: [username]
password: [password]
rails db:setup
rails db:migrate
rails g controller HomePage index
config/routes.rb
root 'home_page#index'
cp irvan-smith-5eBW5GomfhY-unsplash to app/assets/images
app/views/layouts/application.html.erb
<h1>codr.academy</h1>
app/assets/stylesheets/application.css
@import url('https://fonts.googleapis.com/css2?family=Anonymous+Pro:wght@700&display=swap');
body {
margin: 0;
}
h1 {
background-image: url("irvan-smith-5eBW5GomfhY-unsplash.jpg"); /* Photo by Irvan Smith on Unsplash */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
color: white;
font-family: 'Anonymous Pro', monospace;
text-shadow: 0px 0px 1rem orange;
font-size: 3.5rem;
margin: 1rem 0rem;
padding: 1rem 3rem;
}
app/views/home_page/index.html.erb
<h2>HomePage#index</h2>
brew tap heroku/brew && brew install heroku
heroku autocomplete
printf "$(heroku autocomplete:script zsh)" >> ~/.zshrc; source ~/.zshrc
compaudit -D
heroku create codr.academy
git push heroku master
config/environments/production.rb
config.assets.initialize_on_precompile = false
config.assets.compile = true
/^([a-z]{1,30}){1}([]{1}[a-z]{1,30}){,1}([]{1}[a-z]{1,30}){,1}\Z/