RoR Stuff



Ubuntu server setup for RoR

December 11, 2023 07:28

Server config below.  Startting with Ubuntu 22.04LTS. Install Nginx and set SSL certificates Install Nginx sudo apt install nginx Open firewall ports sudo ufw allow 'Nginx HTTP' Set up Ngi...

Ubuntu Systemd service for Ruby on Rails

December 12, 2023 07:23

This is an example of a systemd service file for starting a Ruby on Rails app automatically. File location is /etc/systemd/system [Unit]Description=ror-app-nameAfter=network.target [Service]Type=si...

Seeding Ruby on Rails App with MYSQL dump in CSV format

December 13, 2023 14:59

bin/rails generate model Damageinspections ticketid:integer date:datetime address:string photo:string  bin/rails db:migrate  rails db:seed  bin/rails console  Create  /lib...

RoR with Tailwind CSS

January 10, 2024 06:37

rails new devapp1 --database=postgresql --css tailwind

Ruby on Rails Naming Conventions

January 13, 2024 07:51

Routes - lowercase, with underscores as needed between words Controllers - CamelCase, plural, and append the word "Controller" at the end. Model Class - Singular with the first letter of ...

Ruby on Rails - Scaffolding and Seeding Example

January 13, 2024 08:36

Create the modelrails g scaffold MasterGrant community_goal:string funding_source:string fund_name_type:string area_of_focus:string oversight_department:string oversight_division:string entity_name...

Ruby on Rails Migration Cheat Sheet

January 14, 2024 11:25

Change a database column from string to decimal rails g migration change_tfi_to_string_in_master_grants class change_tfi_to_decimal_in_MasterGrants < ActiveRecord::Migration[7.1] def change e...

Ruby on Rails examples

January 15, 2024 05:30

rails generate migration AddPartNumberToProducts part_number:string  rails c User.find(1).destroy