Follow these steps to get a fully functioning Rails app up and running complete with initial styles and authentication.
-
Install Rails with Postgres:
rails new trix -d postgresql --skip-action-cable --skip-coffee --skip-turbolinks --skip-test
-
Create database:
rake db:create
-
Create UUID migration and run it:
rails g migration enable_uuid_extension
Add this line:enable_extension 'pgcrypto'
-
Create
config/initializers/generators.rb
and add:Rails.application.config.generators do |g| g.orm :active_record, primary_key_type: :uuid end
-
Add libraries to Gemfile and run
bundle
:gem 'devise' gem 'awesome_print' gem 'annotate' gem 'active_link_to'
-
Install Devise:
rails generate devise:install
-
Create a
User
model and run migration:rails generate devise User
-
Install Webpacker:
rails webpacker:install
-
SASS: Change
/assets/stylesheets/application.css
to.scss
and the following:@import 'variables'; @import 'base'; @import 'button'; @import 'form'; @import 'auth';
-
Add fonts to
/views/layouts/application.html.erb
:
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Paytone+One:400,600,700,800&display=swap" rel="stylesheet">