├── .browserslistrc ├── .gitignore ├── .pryrc ├── .ruby-version ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ └── stylesheets │ │ ├── actiontext.scss │ │ ├── application.css │ │ ├── posts.scss │ │ └── scaffolds.scss ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── posts_controller.rb ├── helpers │ ├── application_helper.rb │ └── posts_helper.rb ├── javascript │ ├── channels │ │ ├── consumer.js │ │ └── index.js │ └── packs │ │ └── application.js ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── application_record.rb │ ├── article.rb │ ├── concerns │ │ └── .keep │ └── post.rb └── views │ ├── active_storage │ └── blobs │ │ └── _blob.html.erb │ ├── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb │ └── posts │ ├── _form.html.erb │ ├── _post.json.jbuilder │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder ├── babel.config.js ├── bin ├── build-and-push-image ├── bundle ├── docker-compose-attach ├── rails ├── rake ├── setup ├── webpack ├── webpack-dev-server └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── locale.rb │ ├── mime_types.rb │ └── wrap_parameters.rb ├── locales │ ├── en.yml │ └── ja.yml ├── puma.rb ├── routes.rb ├── storage.yml ├── webpack │ ├── development.js │ ├── environment.js │ ├── production.js │ └── test.js └── webpacker.yml ├── db ├── migrate │ ├── 20190916153904_create_active_storage_tables.active_storage.rb │ ├── 20190916153905_create_action_text_tables.action_text.rb │ ├── 20190916173053_create_posts.rb │ └── 20190920181922_create_articles.rb ├── schema.rb └── seeds.rb ├── docker-compose.build.yml ├── docker-compose.yml ├── entrypoint.sh ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── package.json ├── postcss.config.js ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── storage └── .keep ├── tmp └── .keep ├── vendor └── .keep └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore uploaded files in development. 17 | /storage/* 18 | !/storage/.keep 19 | 20 | /public/assets 21 | .byebug_history 22 | 23 | # Ignore master key for decrypting credentials and more. 24 | /config/master.key 25 | 26 | /public/packs 27 | /public/packs-test 28 | /node_modules 29 | /yarn-error.log 30 | yarn-debug.log* 31 | .yarn-integrity 32 | 33 | /vendor/bundle 34 | -------------------------------------------------------------------------------- /.pryrc: -------------------------------------------------------------------------------- 1 | Pry.config.pager = false 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.3 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.6.3 2 | 3 | # https://yarnpkg.com/lang/en/docs/install/#debian-stable 4 | RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ 5 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ 6 | apt-get update -qq && apt-get install -y nodejs postgresql-client vim && \ 7 | apt-get install -y yarn && \ 8 | apt-get install -y imagemagick && \ 9 | apt-get install -y libvips-tools && \ 10 | apt-get install -y locales 11 | 12 | RUN echo "ja_JP.UTF-8 UTF-8" > /etc/locale.gen && \ 13 | locale-gen ja_JP.UTF-8 && \ 14 | /usr/sbin/update-locale LANG=ja_JP.UTF-8 15 | ENV LC_ALL ja_JP.UTF-8 16 | 17 | ENV APP_PATH=/app 18 | RUN mkdir $APP_PATH 19 | WORKDIR $APP_PATH 20 | COPY Gemfile "${APP_PATH}/Gemfile" 21 | COPY Gemfile.lock "${APP_PATH}/Gemfile.lock" 22 | COPY . /app 23 | 24 | COPY entrypoint.sh /usr/bin/ 25 | RUN chmod +x /usr/bin/entrypoint.sh 26 | ENTRYPOINT ["entrypoint.sh"] 27 | EXPOSE 3000 28 | 29 | CMD ["rails", "server", "-b", "0.0.0.0"] 30 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby '2.6.3' 5 | 6 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7 | gem 'rails', '~> 6.0.0' 8 | # Use postgresql as the database for Active Record 9 | gem 'pg', '>= 0.18', '< 2.0' 10 | # Use Puma as the app server 11 | gem 'puma', '~> 3.11' 12 | # Use SCSS for stylesheets 13 | gem 'sass-rails', '~> 5' 14 | # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 15 | gem 'webpacker', '~> 4.0' 16 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 17 | gem 'jbuilder', '~> 2.7' 18 | # Use Redis adapter to run Action Cable in production 19 | # gem 'redis', '~> 4.0' 20 | # Use Active Model has_secure_password 21 | # gem 'bcrypt', '~> 3.1.7' 22 | 23 | # Use Active Storage variant 24 | gem 'image_processing', '~> 1.2' 25 | 26 | # Reduces boot times through caching; required in config/boot.rb 27 | gem 'bootsnap', '>= 1.4.2', require: false 28 | 29 | group :development, :test do 30 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 31 | gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 32 | 33 | gem 'pry-rails' 34 | gem 'pry-byebug' 35 | end 36 | 37 | group :development do 38 | # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 39 | gem 'web-console', '>= 3.3.0' 40 | gem 'listen', '>= 3.0.5', '< 3.2' 41 | end 42 | 43 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 44 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 45 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (6.0.0) 5 | actionpack (= 6.0.0) 6 | nio4r (~> 2.0) 7 | websocket-driver (>= 0.6.1) 8 | actionmailbox (6.0.0) 9 | actionpack (= 6.0.0) 10 | activejob (= 6.0.0) 11 | activerecord (= 6.0.0) 12 | activestorage (= 6.0.0) 13 | activesupport (= 6.0.0) 14 | mail (>= 2.7.1) 15 | actionmailer (6.0.0) 16 | actionpack (= 6.0.0) 17 | actionview (= 6.0.0) 18 | activejob (= 6.0.0) 19 | mail (~> 2.5, >= 2.5.4) 20 | rails-dom-testing (~> 2.0) 21 | actionpack (6.0.0) 22 | actionview (= 6.0.0) 23 | activesupport (= 6.0.0) 24 | rack (~> 2.0) 25 | rack-test (>= 0.6.3) 26 | rails-dom-testing (~> 2.0) 27 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 28 | actiontext (6.0.0) 29 | actionpack (= 6.0.0) 30 | activerecord (= 6.0.0) 31 | activestorage (= 6.0.0) 32 | activesupport (= 6.0.0) 33 | nokogiri (>= 1.8.5) 34 | actionview (6.0.0) 35 | activesupport (= 6.0.0) 36 | builder (~> 3.1) 37 | erubi (~> 1.4) 38 | rails-dom-testing (~> 2.0) 39 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 40 | activejob (6.0.0) 41 | activesupport (= 6.0.0) 42 | globalid (>= 0.3.6) 43 | activemodel (6.0.0) 44 | activesupport (= 6.0.0) 45 | activerecord (6.0.0) 46 | activemodel (= 6.0.0) 47 | activesupport (= 6.0.0) 48 | activestorage (6.0.0) 49 | actionpack (= 6.0.0) 50 | activejob (= 6.0.0) 51 | activerecord (= 6.0.0) 52 | marcel (~> 0.3.1) 53 | activesupport (6.0.0) 54 | concurrent-ruby (~> 1.0, >= 1.0.2) 55 | i18n (>= 0.7, < 2) 56 | minitest (~> 5.1) 57 | tzinfo (~> 1.1) 58 | zeitwerk (~> 2.1, >= 2.1.8) 59 | bindex (0.8.1) 60 | bootsnap (1.4.4) 61 | msgpack (~> 1.0) 62 | builder (3.2.3) 63 | byebug (11.0.1) 64 | coderay (1.1.2) 65 | concurrent-ruby (1.1.5) 66 | crass (1.0.4) 67 | erubi (1.8.0) 68 | ffi (1.11.1) 69 | globalid (0.4.2) 70 | activesupport (>= 4.2.0) 71 | i18n (1.6.0) 72 | concurrent-ruby (~> 1.0) 73 | image_processing (1.9.3) 74 | mini_magick (>= 4.9.5, < 5) 75 | ruby-vips (>= 2.0.13, < 3) 76 | jbuilder (2.9.1) 77 | activesupport (>= 4.2.0) 78 | listen (3.1.5) 79 | rb-fsevent (~> 0.9, >= 0.9.4) 80 | rb-inotify (~> 0.9, >= 0.9.7) 81 | ruby_dep (~> 1.2) 82 | loofah (2.2.3) 83 | crass (~> 1.0.2) 84 | nokogiri (>= 1.5.9) 85 | mail (2.7.1) 86 | mini_mime (>= 0.1.1) 87 | marcel (0.3.3) 88 | mimemagic (~> 0.3.2) 89 | method_source (0.9.2) 90 | mimemagic (0.3.3) 91 | mini_magick (4.9.5) 92 | mini_mime (1.0.2) 93 | mini_portile2 (2.4.0) 94 | minitest (5.11.3) 95 | msgpack (1.3.1) 96 | nio4r (2.4.0) 97 | nokogiri (1.10.4) 98 | mini_portile2 (~> 2.4.0) 99 | pg (1.1.4) 100 | pry (0.12.2) 101 | coderay (~> 1.1.0) 102 | method_source (~> 0.9.0) 103 | pry-byebug (3.7.0) 104 | byebug (~> 11.0) 105 | pry (~> 0.10) 106 | pry-rails (0.3.9) 107 | pry (>= 0.10.4) 108 | puma (3.12.1) 109 | rack (2.0.7) 110 | rack-proxy (0.6.5) 111 | rack 112 | rack-test (1.1.0) 113 | rack (>= 1.0, < 3) 114 | rails (6.0.0) 115 | actioncable (= 6.0.0) 116 | actionmailbox (= 6.0.0) 117 | actionmailer (= 6.0.0) 118 | actionpack (= 6.0.0) 119 | actiontext (= 6.0.0) 120 | actionview (= 6.0.0) 121 | activejob (= 6.0.0) 122 | activemodel (= 6.0.0) 123 | activerecord (= 6.0.0) 124 | activestorage (= 6.0.0) 125 | activesupport (= 6.0.0) 126 | bundler (>= 1.3.0) 127 | railties (= 6.0.0) 128 | sprockets-rails (>= 2.0.0) 129 | rails-dom-testing (2.0.3) 130 | activesupport (>= 4.2.0) 131 | nokogiri (>= 1.6) 132 | rails-html-sanitizer (1.2.0) 133 | loofah (~> 2.2, >= 2.2.2) 134 | railties (6.0.0) 135 | actionpack (= 6.0.0) 136 | activesupport (= 6.0.0) 137 | method_source 138 | rake (>= 0.8.7) 139 | thor (>= 0.20.3, < 2.0) 140 | rake (12.3.3) 141 | rb-fsevent (0.10.3) 142 | rb-inotify (0.10.0) 143 | ffi (~> 1.0) 144 | ruby-vips (2.0.15) 145 | ffi (~> 1.9) 146 | ruby_dep (1.5.0) 147 | sass (3.7.4) 148 | sass-listen (~> 4.0.0) 149 | sass-listen (4.0.0) 150 | rb-fsevent (~> 0.9, >= 0.9.4) 151 | rb-inotify (~> 0.9, >= 0.9.7) 152 | sass-rails (5.1.0) 153 | railties (>= 5.2.0) 154 | sass (~> 3.1) 155 | sprockets (>= 2.8, < 4.0) 156 | sprockets-rails (>= 2.0, < 4.0) 157 | tilt (>= 1.1, < 3) 158 | sprockets (3.7.2) 159 | concurrent-ruby (~> 1.0) 160 | rack (> 1, < 3) 161 | sprockets-rails (3.2.1) 162 | actionpack (>= 4.0) 163 | activesupport (>= 4.0) 164 | sprockets (>= 3.0.0) 165 | thor (0.20.3) 166 | thread_safe (0.3.6) 167 | tilt (2.0.9) 168 | tzinfo (1.2.5) 169 | thread_safe (~> 0.1) 170 | web-console (4.0.1) 171 | actionview (>= 6.0.0) 172 | activemodel (>= 6.0.0) 173 | bindex (>= 0.4.0) 174 | railties (>= 6.0.0) 175 | webpacker (4.0.7) 176 | activesupport (>= 4.2) 177 | rack-proxy (>= 0.6.1) 178 | railties (>= 4.2) 179 | websocket-driver (0.7.1) 180 | websocket-extensions (>= 0.1.0) 181 | websocket-extensions (0.1.4) 182 | zeitwerk (2.1.9) 183 | 184 | PLATFORMS 185 | ruby 186 | 187 | DEPENDENCIES 188 | bootsnap (>= 1.4.2) 189 | byebug 190 | image_processing (~> 1.2) 191 | jbuilder (~> 2.7) 192 | listen (>= 3.0.5, < 3.2) 193 | pg (>= 0.18, < 2.0) 194 | pry-byebug 195 | pry-rails 196 | puma (~> 3.11) 197 | rails (~> 6.0.0) 198 | sass-rails (~> 5) 199 | tzinfo-data 200 | web-console (>= 3.3.0) 201 | webpacker (~> 4.0) 202 | 203 | RUBY VERSION 204 | ruby 2.6.3p62 205 | 206 | BUNDLED WITH 207 | 1.17.2 208 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ハンズオンで学ぶ Ruby on Rails < Action Text を支えるデータベースアソシエーション編 > 2 | 3 | 本リポジトリは、Udemy のプログラミングコース「ハンズオンで学ぶ Ruby on Rails < Action Text を支えるデータベースアソシエーション編 >」 の動画の中で実際に書いたソースコードを管理するためのものです。 4 | 5 | ソースコードは`git clone`コマンドで取得することが可能です。 6 | 7 | ```bash 8 | $ git clone git@github.com:DiveIntoHacking/rails-6-action-text.git 9 | ``` 10 | 11 | または 12 | 13 | ```bash 14 | $ git clone https://github.com/DiveIntoHacking/rails-6-action-text.git 15 | ``` 16 | 17 | 以下の表は、各レクチャーの名称とそのレクチャーで作成されたブランチ名との対応を示す表です。 18 | 19 | もし、レクチャーの中でうまく動作せず行き詰まったり、あるいは、正常に動作はしたものの自分の書いたコードとの比較を行ったりするといった場合には、 20 | 各ブランチを checkout して参考にしてみてください。 21 | 全てレクチャーの収録時のソースコードと全く同じものを commit しています。 22 | 23 | | レクチャー名 | ブランチ名 | 24 | | ------------------------------------------------------------------------ | ----------------------------------- | 25 | | Action Text に必要なマイグレーションを実行しよう | action-text-install | 26 | | image_processing をインストールしよう | install-image-processing | 27 | | 投稿(post)を scaffold しよう | scaffold-post | 28 | | Post と RichText を関連付けよう | has-rich-text | 29 | | Strong Parameters についておさらいしよう | strong-parameters | 30 | | view に RichText の表示領域を設定しよう | text-field | 31 | | pry を install してデバッグ力をあげよう | install-pry | 32 | | pry-rails を install して rails console でも pry っちゃおう | pry-rails | 33 | | もっと pry を使いこなそう | pry-byebug | 34 | | モデルの相関について見ていこう! - posts テーブル編 | associations | 35 | | モデルの相関について見ていこう! - action_text_rich_texts テーブル編 | N/A | 36 | | モデルの相関について見ていこう! - active_storage_attachments テーブル編 | N/A | 37 | | モデルの相関について見ていこう! - active_storage_blobs テーブル編 | associations | 38 | | モデルの相関について見ていこう! - 全テーブルの ER 図編 | N/A | 39 | | バリデーションを実装しよう - 投稿のタイトル | validation-post-title | 40 | | バリデーション動作をブラウザから確認しよう | validation-ui | 41 | | バリデーションを実装しよう - 投稿の WYSIWYG の長さ | validation-post-content-body | 42 | | バリデーションを実装しよう - 添付ファイルのサイズ | validation-attachment-byte-size | 43 | | バリデーションを実装しよう - 添付ファイルのファイル数 - 演習問題 | practice-validate-attachments-count | 44 | | ゴミデータをぶっ壊す! | N/A | 45 | 46 | ```javascript 47 | /* N/Aの箇所では特別なブランチは存在しません。 */ 48 | ``` 49 | 50 | ## 注意事項 51 | 52 | 本コースでは、[Docker](https://www.docker.com/) が必須になります。Docker 環境を必ず準備してからご受講をお願い致します。 53 | 54 | ## FAQ 55 | 56 | 以下に、git や GitHub に慣れていない方から寄せられる質問をまとめています。 57 | 58 | ### このリポジトリの変更などを知る方法はありますか? 59 | 60 | こちらのリポジトリのトップページの画面上部にある star ボタンをクリックすると、GitHub のトップページのタイムラインにそのリポジトリを追跡することができますのでやってみてください。 61 | 62 | ### 自分のアカウントにリポジトリをぶら下げたいのですが。。。 63 | 64 | fork することで可能です。画面右上の`Fork`ボタンをクリックしてください。 65 | 66 | ### リポジトリを新規に clone を行い、該当のブランチに checkout する方法は? 67 | 68 | `git clone`後に、例えば、`install-image-processing`というブランチを checkout したい場合を例にすると、以下のようにコマンドを実行することになります。 69 | 70 | ```bash 71 | $ git clone https://github.com/DiveIntoHacking/rails-6-action-text.git 72 | $ cd rails-6-action-text 73 | $ git checkout -t origin/install-image-processing 74 | ``` 75 | 76 | 尚、アプリケーションを稼働させるにはさらに以下が必要です。 77 | 78 | ``` 79 | $ docker-compose run --rm web bundle install #=> gemパッケージのインストールに時間がかかります! 80 | $ docker-compose run --rm web yarn install 81 | $ docker-compose run --rm web ./bin/rails db:create 82 | $ docker-compose run --rm web ./bin/rails db:migrate 83 | $ docker-compose up 84 | ``` 85 | 86 | ### あるブランチで実装した内容を知るには? 87 | 88 | 以下の例の様に`git log -p`コマンドで commit の履歴を表示し内容を確認してください。 89 | 90 | ```bash 91 | $ git checkout ${branch_name} 92 | $ git log -p 93 | ``` 94 | 95 | まずレクチャーを進める前に全貌を知っておきたい!という方にはおすすめです。 96 | 97 | ### プログラムの誤りを見つけてたがその連絡の手段は? 98 | 99 | 本プログラムは Udemy 教育用のものですので、受講生からのリクエストを最優先していますので、Udemy のコースに設置されている公式の Q&A にてご指摘の内容をご報告頂ければ有り難いです。 100 | (本プログラムはオープンソースプロジェクトではありませんので GitHub の Issues でお知らせ頂いても対応出来ない場合がありますのでご了承ください。) 101 | 102 | その他、不明な点が有りましたら Udemy の Q&A にてご質問ください。 103 | 104 |
<%= notice %>
2 | 3 |Title | 9 |10 | | ||
---|---|---|---|
<%= post.title %> | 17 |<%= link_to 'Show', post %> | 18 |<%= link_to 'Edit', edit_post_path(post) %> | 19 |<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> | 20 |
<%= notice %>
2 | 3 |4 | Title: 5 | <%= @post.title %> 6 |
7 | 8 | <%= @post.content %> 9 | 10 | <%= link_to 'Edit', edit_post_path(@post) %> | 11 | <%= link_to 'Back', posts_path %> 12 | -------------------------------------------------------------------------------- /app/views/posts/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "posts/post", post: @post 2 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | var validEnv = ['development', 'test', 'production'] 3 | var currentEnv = api.env() 4 | var isDevelopmentEnv = api.env('development') 5 | var isProductionEnv = api.env('production') 6 | var isTestEnv = api.env('test') 7 | 8 | if (!validEnv.includes(currentEnv)) { 9 | throw new Error( 10 | 'Please specify a valid `NODE_ENV` or ' + 11 | '`BABEL_ENV` environment variables. Valid values are "development", ' + 12 | '"test", and "production". Instead, received: ' + 13 | JSON.stringify(currentEnv) + 14 | '.' 15 | ) 16 | } 17 | 18 | return { 19 | presets: [ 20 | isTestEnv && [ 21 | require('@babel/preset-env').default, 22 | { 23 | targets: { 24 | node: 'current' 25 | } 26 | } 27 | ], 28 | (isProductionEnv || isDevelopmentEnv) && [ 29 | require('@babel/preset-env').default, 30 | { 31 | forceAllTransforms: true, 32 | useBuiltIns: 'entry', 33 | corejs: 3, 34 | modules: false, 35 | exclude: ['transform-typeof-symbol'] 36 | } 37 | ] 38 | ].filter(Boolean), 39 | plugins: [ 40 | require('babel-plugin-macros'), 41 | require('@babel/plugin-syntax-dynamic-import').default, 42 | isTestEnv && require('babel-plugin-dynamic-import-node'), 43 | require('@babel/plugin-transform-destructuring').default, 44 | [ 45 | require('@babel/plugin-proposal-class-properties').default, 46 | { 47 | loose: true 48 | } 49 | ], 50 | [ 51 | require('@babel/plugin-proposal-object-rest-spread').default, 52 | { 53 | useBuiltIns: true 54 | } 55 | ], 56 | [ 57 | require('@babel/plugin-transform-runtime').default, 58 | { 59 | helpers: false, 60 | regenerator: true, 61 | corejs: false 62 | } 63 | ], 64 | [ 65 | require('@babel/plugin-transform-regenerator').default, 66 | { 67 | async: false 68 | } 69 | ] 70 | ].filter(Boolean) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /bin/build-and-push-image: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | docker-compose -f docker-compose.build.yml build --no-cache 6 | 7 | target_tag_image="diveintohacking/docker-compose-rails-6:${1}" 8 | 9 | docker tag docker-compose-rails-6_web:latest $target_tag_image 10 | 11 | docker push $target_tag_image 12 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 || ">= 0.a" 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../../Gemfile", __FILE__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_version 64 | @bundler_version ||= begin 65 | env_var_version || cli_arg_version || 66 | lockfile_version || "#{Gem::Requirement.default}.a" 67 | end 68 | end 69 | 70 | def load_bundler! 71 | ENV["BUNDLE_GEMFILE"] ||= gemfile 72 | 73 | # must dup string for RG < 1.8 compatibility 74 | activate_bundler(bundler_version.dup) 75 | end 76 | 77 | def activate_bundler(bundler_version) 78 | if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0") 79 | bundler_version = "< 2" 80 | end 81 | gem_error = activation_error_handling do 82 | gem "bundler", bundler_version 83 | end 84 | return if gem_error.nil? 85 | require_error = activation_error_handling do 86 | require "bundler/version" 87 | end 88 | return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 89 | warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`" 90 | exit 42 91 | end 92 | 93 | def activation_error_handling 94 | yield 95 | nil 96 | rescue StandardError, LoadError => e 97 | e 98 | end 99 | end 100 | 101 | m.load_bundler! 102 | 103 | if m.invoked_as_script? 104 | load Gem.bin_path("bundler", "bundle") 105 | end 106 | -------------------------------------------------------------------------------- /bin/docker-compose-attach: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker-compose up -d && docker attach $(docker-compose ps -q $1) 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../config/application', __dir__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to setup or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at anytime and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | # system('bin/yarn') 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /bin/webpack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "rubygems" 11 | require "bundler/setup" 12 | 13 | require "webpacker" 14 | require "webpacker/webpack_runner" 15 | 16 | APP_ROOT = File.expand_path("..", __dir__) 17 | Dir.chdir(APP_ROOT) do 18 | Webpacker::WebpackRunner.run(ARGV) 19 | end 20 | -------------------------------------------------------------------------------- /bin/webpack-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "rubygems" 11 | require "bundler/setup" 12 | 13 | require "webpacker" 14 | require "webpacker/dev_server_runner" 15 | 16 | APP_ROOT = File.expand_path("..", __dir__) 17 | Dir.chdir(APP_ROOT) do 18 | Webpacker::DevServerRunner.run(ARGV) 19 | end 20 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require "rails" 4 | # Pick the frameworks you want: 5 | require "active_model/railtie" 6 | require "active_job/railtie" 7 | require "active_record/railtie" 8 | require "active_storage/engine" 9 | require "action_controller/railtie" 10 | require "action_mailer/railtie" 11 | require "action_mailbox/engine" 12 | require "action_text/engine" 13 | require "action_view/railtie" 14 | require "action_cable/engine" 15 | require "sprockets/railtie" 16 | # require "rails/test_unit/railtie" 17 | 18 | # Require the gems listed in Gemfile, including any gems 19 | # you've limited to :test, :development, or :production. 20 | Bundler.require(*Rails.groups) 21 | 22 | module App 23 | class Application < Rails::Application 24 | # Initialize configuration defaults for originally generated Rails version. 25 | config.load_defaults 6.0 26 | 27 | # Settings in config/environments/* take precedence over those specified here. 28 | # Application configuration can go into files in config/initializers 29 | # -- all .rb files in that directory are automatically loaded after loading 30 | # the framework and any gems in your application. 31 | 32 | # Don't generate system test files. 33 | config.generators.system_tests = nil 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: app_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | OxdtgRhetooipo0eQS4Ws+DZILfWbN5qBPPNtvZ1CouWTKiDcqggDcSo30l2KUCRe06X7eOHKWhjBqP22dt9h98KcqhdlGuTOsGxEGxU5a2NFmMdiP1/4KOTfAwrI7D70BuPjPPmQpNeX2IRx1kWdFsmoKUgORBhfsf1mDgbXQyHrAmq396nUjGifttrqZxXscDb6RpbaM4uLGbntBw+FAO7qrRwnUsuY1BXIGYAsNsHLCUMJTgIyCMxfD8wcf5DiKrDFCLLEJl7xCY45Zgu0yt7ParJhFchXOymQryI3YZuu2xOP6WznDKH+xtKgd/o5v7shosbrpTng3/d+xvJg9sqrgZndQk2LGBdy4t6QzUcxjKPLU4hF3xCjCX3LAoKnNYxUTZgxIJa0GaWxP220YszuSCX0ZcA4Grk--bDnzlXfB6JzhUrM/--FevlraKW73uTev320nkhcg== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.3 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On macOS with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On macOS with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem 'pg' 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | host: db 21 | username: postgres 22 | password: 23 | # For details on connection pooling, see Rails configuration guide 24 | # https://guides.rubyonrails.org/configuring.html#database-pooling 25 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 26 | 27 | development: 28 | <<: *default 29 | database: app_development 30 | 31 | # The specified database role being used to connect to postgres. 32 | # To create additional roles in postgres see `$ createuser --help`. 33 | # When left blank, postgres will use the default role. This is 34 | # the same name as the operating system user that initialized the database. 35 | #username: app 36 | 37 | # The password associated with the postgres role (username). 38 | #password: 39 | 40 | # Connect on a TCP socket. Omitted by default since the client uses a 41 | # domain socket that doesn't need configuration. Windows does not have 42 | # domain sockets, so uncomment these lines. 43 | #host: localhost 44 | 45 | # The TCP port the server listens on. Defaults to 5432. 46 | # If your server runs on a different port number, change accordingly. 47 | #port: 5432 48 | 49 | # Schema search path. The server defaults to $user,public 50 | #schema_search_path: myapp,sharedapp,public 51 | 52 | # Minimum log levels, in increasing order: 53 | # debug5, debug4, debug3, debug2, debug1, 54 | # log, notice, warning, error, fatal, and panic 55 | # Defaults to warning. 56 | #min_messages: notice 57 | 58 | # Warning: The database defined as "test" will be erased and 59 | # re-generated from your development database when you run "rake". 60 | # Do not set this db to the same as development or production. 61 | test: 62 | <<: *default 63 | database: app_test 64 | 65 | # As with config/credentials.yml, you never want to store sensitive information, 66 | # like your database password, in your source code. If your source code is 67 | # ever seen by anyone, they now have access to your database. 68 | # 69 | # Instead, provide the password as a unix environment variable when you boot 70 | # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database 71 | # for a full rundown on how to provide these environment variables in a 72 | # production deployment. 73 | # 74 | # On Heroku and other platform providers, you may have a full connection URL 75 | # available as an environment variable. For example: 76 | # 77 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 78 | # 79 | # You can use this database configuration with: 80 | # 81 | # production: 82 | # url: <%= ENV['DATABASE_URL'] %> 83 | # 84 | production: 85 | <<: *default 86 | database: app_production 87 | username: app 88 | password: <%= ENV['APP_DATABASE_PASSWORD'] %> 89 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports. 13 | config.consider_all_requests_local = true 14 | 15 | # Enable/disable caching. By default caching is disabled. 16 | # Run rails dev:cache to toggle caching. 17 | if Rails.root.join('tmp', 'caching-dev.txt').exist? 18 | config.action_controller.perform_caching = true 19 | config.action_controller.enable_fragment_cache_logging = true 20 | 21 | config.cache_store = :memory_store 22 | config.public_file_server.headers = { 23 | 'Cache-Control' => "public, max-age=#{2.days.to_i}" 24 | } 25 | else 26 | config.action_controller.perform_caching = false 27 | 28 | config.cache_store = :null_store 29 | end 30 | 31 | # Store uploaded files on the local file system (see config/storage.yml for options). 32 | config.active_storage.service = :local 33 | 34 | # Don't care if the mailer can't send. 35 | config.action_mailer.raise_delivery_errors = false 36 | 37 | config.action_mailer.perform_caching = false 38 | 39 | # Print deprecation notices to the Rails logger. 40 | config.active_support.deprecation = :log 41 | 42 | # Raise an error on page load if there are pending migrations. 43 | config.active_record.migration_error = :page_load 44 | 45 | # Highlight code that triggered database queries in logs. 46 | config.active_record.verbose_query_logs = true 47 | 48 | # Debug mode disables concatenation and preprocessing of assets. 49 | # This option may cause significant delays in view rendering with a large 50 | # number of complex assets. 51 | config.assets.debug = true 52 | 53 | # Suppress logger output for asset requests. 54 | config.assets.quiet = true 55 | 56 | # Raises error for missing translations. 57 | # config.action_view.raise_on_missing_translations = true 58 | 59 | # Use an evented file watcher to asynchronously detect changes in source code, 60 | # routes, locales, etc. This feature depends on the listen gem. 61 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 62 | end 63 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 18 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 19 | # config.require_master_key = true 20 | 21 | # Disable serving static files from the `/public` folder by default since 22 | # Apache or NGINX already handles this. 23 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 24 | 25 | # Compress CSS using a preprocessor. 26 | # config.assets.css_compressor = :sass 27 | 28 | # Do not fallback to assets pipeline if a precompiled asset is missed. 29 | config.assets.compile = false 30 | 31 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 32 | # config.action_controller.asset_host = 'http://assets.example.com' 33 | 34 | # Specifies the header that your server uses for sending files. 35 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 36 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 37 | 38 | # Store uploaded files on the local file system (see config/storage.yml for options). 39 | config.active_storage.service = :local 40 | 41 | # Mount Action Cable outside main process or domain. 42 | # config.action_cable.mount_path = nil 43 | # config.action_cable.url = 'wss://example.com/cable' 44 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 45 | 46 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 47 | # config.force_ssl = true 48 | 49 | # Use the lowest log level to ensure availability of diagnostic information 50 | # when problems arise. 51 | config.log_level = :debug 52 | 53 | # Prepend all log lines with the following tags. 54 | config.log_tags = [ :request_id ] 55 | 56 | # Use a different cache store in production. 57 | # config.cache_store = :mem_cache_store 58 | 59 | # Use a real queuing backend for Active Job (and separate queues per environment). 60 | # config.active_job.queue_adapter = :resque 61 | # config.active_job.queue_name_prefix = "app_production" 62 | 63 | config.action_mailer.perform_caching = false 64 | 65 | # Ignore bad email addresses and do not raise email delivery errors. 66 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 67 | # config.action_mailer.raise_delivery_errors = false 68 | 69 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 70 | # the I18n.default_locale when a translation cannot be found). 71 | config.i18n.fallbacks = true 72 | 73 | # Send deprecation notices to registered listeners. 74 | config.active_support.deprecation = :notify 75 | 76 | # Use default logging formatter so that PID and timestamp are not suppressed. 77 | config.log_formatter = ::Logger::Formatter.new 78 | 79 | # Use a different logger for distributed setups. 80 | # require 'syslog/logger' 81 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 82 | 83 | if ENV["RAILS_LOG_TO_STDOUT"].present? 84 | logger = ActiveSupport::Logger.new(STDOUT) 85 | logger.formatter = config.log_formatter 86 | config.logger = ActiveSupport::TaggedLogging.new(logger) 87 | end 88 | 89 | # Do not dump schema after migrations. 90 | config.active_record.dump_schema_after_migration = false 91 | 92 | # Inserts middleware to perform automatic connection switching. 93 | # The `database_selector` hash is used to pass options to the DatabaseSelector 94 | # middleware. The `delay` is used to determine how long to wait after a write 95 | # to send a subsequent read to the primary. 96 | # 97 | # The `database_resolver` class is used by the middleware to determine which 98 | # database is appropriate to use based on the time delay. 99 | # 100 | # The `database_resolver_context` class is used by the middleware to set 101 | # timestamps for the last write to the primary. The resolver uses the context 102 | # class timestamps to determine how long to wait before reading from the 103 | # replica. 104 | # 105 | # By default Rails will store a last write timestamp in the session. The 106 | # DatabaseSelector middleware is designed as such you can define your own 107 | # strategy for connection switching and pass that into the middleware through 108 | # these configuration options. 109 | # config.active_record.database_selector = { delay: 2.seconds } 110 | # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver 111 | # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session 112 | end 113 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | # The test environment is used exclusively to run your application's 2 | # test suite. You never need to work with it otherwise. Remember that 3 | # your test database is "scratch space" for the test suite and is wiped 4 | # and recreated between test runs. Don't rely on the data there! 5 | 6 | Rails.application.configure do 7 | # Settings specified here will take precedence over those in config/application.rb. 8 | 9 | config.cache_classes = true 10 | 11 | # Do not eager load code on boot. This avoids loading your whole application 12 | # just for the purpose of running a single test. If you are using a tool that 13 | # preloads Rails for running tests, you may have to set it to true. 14 | config.eager_load = false 15 | 16 | # Configure public file server for tests with Cache-Control for performance. 17 | config.public_file_server.enabled = true 18 | config.public_file_server.headers = { 19 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}" 20 | } 21 | 22 | # Show full error reports and disable caching. 23 | config.consider_all_requests_local = true 24 | config.action_controller.perform_caching = false 25 | config.cache_store = :null_store 26 | 27 | # Raise exceptions instead of rendering exception templates. 28 | config.action_dispatch.show_exceptions = false 29 | 30 | # Disable request forgery protection in test environment. 31 | config.action_controller.allow_forgery_protection = false 32 | 33 | # Store uploaded files on the local file system in a temporary directory. 34 | config.active_storage.service = :test 35 | 36 | config.action_mailer.perform_caching = false 37 | 38 | # Tell Action Mailer not to deliver emails to the real world. 39 | # The :test delivery method accumulates sent emails in the 40 | # ActionMailer::Base.deliveries array. 41 | config.action_mailer.delivery_method = :test 42 | 43 | # Print deprecation notices to the stderr. 44 | config.active_support.deprecation = :stderr 45 | 46 | # Raises error for missing translations. 47 | # config.action_view.raise_on_missing_translations = true 48 | end 49 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy 4 | # For further information see the following documentation 5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 6 | 7 | # Rails.application.config.content_security_policy do |policy| 8 | # policy.default_src :self, :https 9 | # policy.font_src :self, :https, :data 10 | # policy.img_src :self, :https, :data 11 | # policy.object_src :none 12 | # policy.script_src :self, :https 13 | # policy.style_src :self, :https 14 | # # If you are using webpack-dev-server then specify webpack-dev-server host 15 | # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? 16 | 17 | # # Specify URI for violation reports 18 | # # policy.report_uri "/csp-violation-report-endpoint" 19 | # end 20 | 21 | # If you are using UJS then enable automatic nonce generation 22 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 23 | 24 | # Set the nonce only to specific directives 25 | # Rails.application.config.content_security_policy_nonce_directives = %w(script-src) 26 | 27 | # Report CSP violations to a specified URI 28 | # For further information see the following documentation: 29 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 30 | # Rails.application.config.content_security_policy_report_only = true 31 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/locale.rb: -------------------------------------------------------------------------------- 1 | # Where the I18n library should search for translation files 2 | I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')] 3 | 4 | # Permitted locales available for the application 5 | I18n.available_locales = [:en, :ja] 6 | 7 | # Set default locale to something other than :en 8 | I18n.default_locale = :ja 9 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/locales/ja.yml: -------------------------------------------------------------------------------- 1 | ja: 2 | activerecord: 3 | errors: 4 | models: 5 | post: 6 | attributes: 7 | base: 8 | content_attachment_byte_size_is_too_big: 添付ファイルは%{max_content_attachment_mega_byte_size}MB以下にしてください。[%{bytes}/%{max_bytes}] 9 | title: 10 | blank: が空です。 11 | too_long: が%{count}文字を超えています。 12 | content: 13 | too_long: が%{max_content_length}文字を超えています。[%{length}/%{max_content_length}] 14 | attachments_count_is_too_big: の添付画像の数が%{max_content_attachments_count}個を超えています。 15 | attributes: 16 | post: 17 | title: タイトル 18 | content: コンテンツ 19 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 12 | # 13 | port ENV.fetch("PORT") { 3000 } 14 | 15 | # Specifies the `environment` that Puma will run in. 16 | # 17 | environment ENV.fetch("RAILS_ENV") { "development" } 18 | 19 | # Specifies the `pidfile` that Puma will use. 20 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 21 | 22 | # Specifies the number of `workers` to boot in clustered mode. 23 | # Workers are forked web server processes. If using threads and workers together 24 | # the concurrency of the application would be max `threads` * `workers`. 25 | # Workers do not work on JRuby or Windows (both of which do not support 26 | # processes). 27 | # 28 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 29 | 30 | # Use the `preload_app!` method when specifying a `workers` number. 31 | # This directive tells Puma to first boot the application and load code 32 | # before forking the application. This takes advantage of Copy On Write 33 | # process behavior so workers use less memory. 34 | # 35 | # preload_app! 36 | 37 | # Allow puma to be restarted by `rails restart` command. 38 | plugin :tmp_restart 39 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | resources :posts 3 | # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html 4 | end 5 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /config/webpack/development.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require('@rails/webpacker') 2 | 3 | module.exports = environment 4 | -------------------------------------------------------------------------------- /config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpacker.yml: -------------------------------------------------------------------------------- 1 | # Note: You must restart bin/webpack-dev-server for changes to take effect 2 | 3 | default: &default 4 | source_path: app/javascript 5 | source_entry_path: packs 6 | public_root_path: public 7 | public_output_path: packs 8 | cache_path: tmp/cache/webpacker 9 | check_yarn_integrity: false 10 | webpack_compile_output: false 11 | 12 | # Additional paths webpack should lookup modules 13 | # ['app/assets', 'engine/foo/app/assets'] 14 | resolved_paths: [] 15 | 16 | # Reload manifest.json on all requests so we reload latest compiled packs 17 | cache_manifest: false 18 | 19 | # Extract and emit a css file 20 | extract_css: false 21 | 22 | static_assets_extensions: 23 | - .jpg 24 | - .jpeg 25 | - .png 26 | - .gif 27 | - .tiff 28 | - .ico 29 | - .svg 30 | - .eot 31 | - .otf 32 | - .ttf 33 | - .woff 34 | - .woff2 35 | 36 | extensions: 37 | - .mjs 38 | - .js 39 | - .sass 40 | - .scss 41 | - .css 42 | - .module.sass 43 | - .module.scss 44 | - .module.css 45 | - .png 46 | - .svg 47 | - .gif 48 | - .jpeg 49 | - .jpg 50 | 51 | development: 52 | <<: *default 53 | compile: true 54 | 55 | # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules 56 | check_yarn_integrity: false 57 | 58 | # Reference: https://webpack.js.org/configuration/dev-server/ 59 | dev_server: 60 | https: false 61 | host: localhost 62 | port: 3035 63 | public: localhost:3035 64 | hmr: false 65 | # Inline should be set to true if using HMR 66 | inline: true 67 | overlay: true 68 | compress: true 69 | disable_host_check: true 70 | use_local_ip: false 71 | quiet: false 72 | headers: 73 | 'Access-Control-Allow-Origin': '*' 74 | watch_options: 75 | ignored: '**/node_modules/**' 76 | 77 | 78 | test: 79 | <<: *default 80 | compile: true 81 | 82 | # Compile test packs to a separate directory 83 | public_output_path: packs-test 84 | 85 | production: 86 | <<: *default 87 | 88 | # Production depends on precompilation of packs prior to booting for performance. 89 | compile: false 90 | 91 | # Extract and emit a css file 92 | extract_css: true 93 | 94 | # Cache manifest.json for performance 95 | cache_manifest: true 96 | -------------------------------------------------------------------------------- /db/migrate/20190916153904_create_active_storage_tables.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20170806125915) 2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2] 3 | def change 4 | create_table :active_storage_blobs do |t| 5 | t.string :key, null: false 6 | t.string :filename, null: false 7 | t.string :content_type 8 | t.text :metadata 9 | t.bigint :byte_size, null: false 10 | t.string :checksum, null: false 11 | t.datetime :created_at, null: false 12 | 13 | t.index [ :key ], unique: true 14 | end 15 | 16 | create_table :active_storage_attachments do |t| 17 | t.string :name, null: false 18 | t.references :record, null: false, polymorphic: true, index: false 19 | t.references :blob, null: false 20 | 21 | t.datetime :created_at, null: false 22 | 23 | t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true 24 | t.foreign_key :active_storage_blobs, column: :blob_id 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /db/migrate/20190916153905_create_action_text_tables.action_text.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from action_text (originally 20180528164100) 2 | class CreateActionTextTables < ActiveRecord::Migration[6.0] 3 | def change 4 | create_table :action_text_rich_texts do |t| 5 | t.string :name, null: false 6 | t.text :body, size: :long 7 | t.references :record, null: false, polymorphic: true, index: false 8 | 9 | t.timestamps 10 | 11 | t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190916173053_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20190920181922_create_articles.rb: -------------------------------------------------------------------------------- 1 | class CreateArticles < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :articles do |t| 4 | 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `rails 6 | # db:schema:load`. When creating a new database, `rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 2019_09_20_181922) do 14 | 15 | # These are extensions that must be enabled in order to support this database 16 | enable_extension "plpgsql" 17 | 18 | create_table "action_text_rich_texts", force: :cascade do |t| 19 | t.string "name", null: false 20 | t.text "body" 21 | t.string "record_type", null: false 22 | t.bigint "record_id", null: false 23 | t.datetime "created_at", precision: 6, null: false 24 | t.datetime "updated_at", precision: 6, null: false 25 | t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true 26 | end 27 | 28 | create_table "active_storage_attachments", force: :cascade do |t| 29 | t.string "name", null: false 30 | t.string "record_type", null: false 31 | t.bigint "record_id", null: false 32 | t.bigint "blob_id", null: false 33 | t.datetime "created_at", null: false 34 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" 35 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true 36 | end 37 | 38 | create_table "active_storage_blobs", force: :cascade do |t| 39 | t.string "key", null: false 40 | t.string "filename", null: false 41 | t.string "content_type" 42 | t.text "metadata" 43 | t.bigint "byte_size", null: false 44 | t.string "checksum", null: false 45 | t.datetime "created_at", null: false 46 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true 47 | end 48 | 49 | create_table "articles", force: :cascade do |t| 50 | t.datetime "created_at", precision: 6, null: false 51 | t.datetime "updated_at", precision: 6, null: false 52 | end 53 | 54 | create_table "posts", force: :cascade do |t| 55 | t.string "title" 56 | t.datetime "created_at", precision: 6, null: false 57 | t.datetime "updated_at", precision: 6, null: false 58 | end 59 | 60 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" 61 | end 62 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /docker-compose.build.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | db: 4 | image: postgres 5 | volumes: 6 | - ./tmp/db:/var/lib/postgresql/data 7 | web: 8 | build: . 9 | command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" 10 | volumes: 11 | - .:/app 12 | environment: 13 | - BUNDLE_PATH=/app/vendor/bundle 14 | ports: 15 | - "3000:3000" 16 | depends_on: 17 | - db 18 | stdin_open: true 19 | tty: true 20 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | db: 4 | image: postgres:9.6.16 5 | volumes: 6 | - postgresql_data:/var/lib/postgresql/data 7 | web: 8 | image: diveintohacking/docker-compose-rails-6:0.0.4 9 | command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" 10 | volumes: 11 | - .:/app 12 | environment: 13 | - BUNDLE_PATH=/app/vendor/bundle 14 | ports: 15 | - "3000:3000" 16 | depends_on: 17 | - db 18 | stdin_open: true 19 | tty: true 20 | volumes: 21 | postgresql_data: 22 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Remove a potentially pre-existing server.pid for Rails. 6 | rm -f /app/tmp/pids/server.pid 7 | 8 | # Then exec the container's main process (what's set as CMD in the Dockerfile). 9 | exec "$@" 10 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiveIntoHacking/rails-6-action-text/ccb258cd44a5f8d1814e0ec96bc55ca718fa2d72/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiveIntoHacking/rails-6-action-text/ccb258cd44a5f8d1814e0ec96bc55ca718fa2d72/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiveIntoHacking/rails-6-action-text/ccb258cd44a5f8d1814e0ec96bc55ca718fa2d72/log/.keep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/actioncable": "^6.0.0-alpha", 6 | "@rails/actiontext": "^6.0.0", 7 | "@rails/activestorage": "^6.0.0-alpha", 8 | "@rails/ujs": "^6.0.0-alpha", 9 | "@rails/webpacker": "^4.0.7", 10 | "trix": "^1.0.0" 11 | }, 12 | "version": "0.1.0", 13 | "devDependencies": { 14 | "webpack-dev-server": "^3.8.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |If you are the application owner check the logs for more information.
64 |