Command: heroku pgbackups:capture --remote production
Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712
Command: heroku pgbackups:url [db_key] --remote production
| # Spin up a new rails application and make sure your database and schema is created | |
| rails new example-app -T -d postgresql | |
| # Add and install the following gems to your Gemfile | |
| group :development, :test do | |
| ... | |
| gem 'rspec-rails' | |
| gem 'capybara' | |
| gem 'selenium-webdriver' | |
| end |
#Docker
##Files and Folders.
|
|\_ app
|...
|\_ docker
| |
| # app/controllers/posts_controller.rb | |
| class PostsController < ApplicationController | |
| def create | |
| @post = Post.new(post_params) | |
| CreatePost.call(@post) do |success, failure| | |
| success.call { redirect_to posts_path, notice: 'Successfully created post.' } | |
| failure.call { render :new } | |
| end | |
| end | |
| end |
| // app/assets/stylesheets/home.css | |
| h1 { color: green; } | |
| // app/javascript/stylesheets/application.scss | |
| @import "~bootstrap/scss/bootstrap"; // never forget the semicolon | |
| @import "./_custom"; | |
| @import "stylesheets/home"; |
| { | |
| "name": "helloworld", | |
| "private": true, | |
| "dependencies": { | |
| "@rails/actioncable": "^6.0.0-alpha", | |
| "@rails/activestorage": "^6.0.0-alpha", | |
| "@rails/ujs": "^6.0.0-alpha", | |
| "@rails/webpacker": "^4.0.7", | |
| "bootstrap": "^4.3.1", | |
| "jquery": "^3.4.1", |
| # config/routes.rb | |
| Rails.application.routes.draw do | |
| get '/calendar', to: 'calendar#index' | |
| root to: 'home#index' | |
| end | |
| # app/javascript/packs/calendar.js | |
| alert('Calendar loaded') | |
| # app/controllers/calendar_controller.rb |
| # app/javascript/packs/stylesheets/application.scss | |
| @import "~bootstrap/scss/bootstrap"; // never forget the semicolon at the end | |
| @import "./_custom"; | |
| # app/javascript/packs/stylesheets/_custom.scss | |
| h1 { | |
| color: red; | |
| } |
| require("@rails/ujs").start() | |
| require("turbolinks").start() | |
| require("@rails/activestorage").start() | |
| require("channels") | |
| import 'bootstrap' | |
| document.addEventListener("turbolinks:load", () => { | |
| $('[data-toggle="tooltip"]').tooltip() | |
| }) |
| const { environment } = require('@rails/webpacker') | |
| const webpack = require('webpack') | |
| environment.plugins.append('Provide', | |
| new webpack.ProvidePlugin({ | |
| $: 'jquery', | |
| jQuery: 'jquery', | |
| Popper: ['popper.js', 'default'] | |
| }) | |
| ) |