├── .dockerignore
├── .gitattributes
├── .github
├── dependabot.yml
└── workflows
│ └── ci.yml
├── .gitignore
├── .prettierignore
├── .prettierrc.json
├── .rubocop.yml
├── .ruby-version
├── Dockerfile
├── Gemfile
├── Gemfile.lock
├── Procfile.dev
├── README.md
├── Rakefile
├── app
├── assets
│ ├── builds
│ │ └── .keep
│ ├── images
│ │ ├── .keep
│ │ └── rails-logo.png
│ └── stylesheets
│ │ ├── application.css
│ │ └── application.tailwind.css
├── channels
│ └── application_cable
│ │ ├── channel.rb
│ │ └── connection.rb
├── controllers
│ ├── application_controller.rb
│ ├── concerns
│ │ └── .keep
│ └── invoices_controller.rb
├── helpers
│ ├── application_helper.rb
│ ├── invoices_helper.rb
│ └── posts
│ │ └── tags_helper.rb
├── javascript
│ ├── application.js
│ └── controllers
│ │ ├── application.js
│ │ ├── focus_controller.js
│ │ ├── hello_controller.js
│ │ ├── index.js
│ │ └── remove_controller.js
├── jobs
│ └── application_job.rb
├── mailers
│ └── application_mailer.rb
├── models
│ ├── application_record.rb
│ ├── concerns
│ │ └── .keep
│ └── invoice.rb
└── views
│ ├── application
│ └── welcome.html.erb
│ ├── invoices
│ └── index.html.erb
│ ├── kaminari
│ ├── _first_page.html.erb
│ ├── _gap.html.erb
│ ├── _last_page.html.erb
│ ├── _next_page.html.erb
│ ├── _page.html.erb
│ ├── _paginator.html.erb
│ └── _prev_page.html.erb
│ ├── layouts
│ ├── _footer.html.erb
│ ├── application.html.erb
│ ├── mailer.html.erb
│ └── mailer.text.erb
│ └── pwa
│ ├── manifest.json.erb
│ └── service-worker.js
├── bin
├── brakeman
├── bundle
├── debug
├── deploy
├── dev
├── docker-entrypoint
├── importmap
├── rails
├── rake
├── rubocop
└── setup
├── config.ru
├── config
├── application.rb
├── boot.rb
├── cable.yml
├── credentials.yml.enc
├── database.yml
├── environment.rb
├── environments
│ ├── development.rb
│ ├── production.rb
│ └── test.rb
├── importmap.rb
├── initializers
│ ├── assets.rb
│ ├── content_security_policy.rb
│ ├── enable_yjit.rb
│ ├── filter_parameter_logging.rb
│ ├── inflections.rb
│ ├── kaminari_config.rb
│ └── permissions_policy.rb
├── locales
│ └── en.yml
├── puma.rb
├── routes.rb
├── storage.yml
└── tailwind.config.js
├── db
├── migrate
│ └── 20240204163053_create_invoices.rb
├── schema.rb
└── seeds.rb
├── lib
├── assets
│ └── .keep
└── tasks
│ └── .keep
├── log
└── .keep
├── public
├── 404.html
├── 422.html
├── 426.html
├── 500.html
├── android-chrome-192x192.png
├── android-chrome-512x512.png
├── apple-touch-icon.png
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon.ico
└── robots.txt
├── storage
└── .keep
├── tmp
├── .keep
├── pids
│ └── .keep
└── storage
│ └── .keep
└── vendor
├── .keep
└── javascript
└── .keep
/.dockerignore:
--------------------------------------------------------------------------------
1 | # See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2 |
3 | # Ignore git directory.
4 | /.git/
5 | /.gitignore
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore all environment files (except templates).
11 | /.env*
12 | !/.env*.erb
13 |
14 | # Ignore all default key files.
15 | /config/master.key
16 | /config/credentials/*.key
17 |
18 | # Ignore all logfiles and tempfiles.
19 | /log/*
20 | /tmp/*
21 | !/log/.keep
22 | !/tmp/.keep
23 |
24 | # Ignore pidfiles, but keep the directory.
25 | /tmp/pids/*
26 | !/tmp/pids/.keep
27 |
28 | # Ignore storage (uploaded files in development and any SQLite databases).
29 | /storage/*
30 | !/storage/.keep
31 | /tmp/storage/*
32 | !/tmp/storage/.keep
33 |
34 | # Ignore assets.
35 | /node_modules/
36 | /app/assets/builds/*
37 | !/app/assets/builds/.keep
38 | /public/assets
39 |
40 | # Ignore CI service files.
41 | /.github
42 |
43 | # Ignore Docker-related files
44 | /.dockerignore
45 | /Dockerfile*
46 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 |
3 | # Mark the database schema as having been generated.
4 | db/schema.rb linguist-generated
5 |
6 | # Mark any vendored files as having been vendored.
7 | vendor/* linguist-vendored
8 | config/credentials/*.yml.enc diff=rails_credentials
9 | config/credentials.yml.enc diff=rails_credentials
10 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: bundler
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | open-pull-requests-limit: 10
8 | - package-ecosystem: github-actions
9 | directory: "/"
10 | schedule:
11 | interval: daily
12 | open-pull-requests-limit: 10
13 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches: [main]
7 |
8 | jobs:
9 | lint:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout code
13 | uses: actions/checkout@v4
14 |
15 | - name: Set up Ruby
16 | uses: ruby/setup-ruby@v1
17 | with:
18 | ruby-version: .ruby-version
19 | bundler-cache: true
20 |
21 | - name: Lint code for consistent style
22 | run: bin/rubocop -f github
23 |
--------------------------------------------------------------------------------
/.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 environment files (except templates).
11 | /.env*
12 | !/.env*.erb
13 | !.env.example
14 |
15 | # Ignore all logfiles and tempfiles.
16 | /log/*
17 | /tmp/*
18 | !/log/.keep
19 | !/tmp/.keep
20 |
21 | # Ignore pidfiles, but keep the directory.
22 | /tmp/pids/*
23 | !/tmp/pids/
24 | !/tmp/pids/.keep
25 |
26 | # Ignore storage (uploaded files in development and any SQLite databases).
27 | /storage/*
28 | !/storage/.keep
29 | /tmp/storage/*
30 | !/tmp/storage/
31 | !/tmp/storage/.keep
32 |
33 | /public/assets
34 |
35 | # Ignore master key for decrypting credentials and more.
36 | /config/master.key
37 |
38 | /app/assets/builds/*
39 | !/app/assets/builds/.keep
40 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
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 pidfiles, but keep the directory.
17 | /tmp/pids/*
18 | !/tmp/pids/
19 | !/tmp/pids/.keep
20 |
21 | # Ignore storage (uploaded files in development and any SQLite databases).
22 | /storage/*
23 | !/storage/.keep
24 | /tmp/storage/*
25 | !/tmp/storage/
26 | !/tmp/storage/.keep
27 |
28 | /public/assets
29 |
30 | # Ignore master key for decrypting credentials and more.
31 | /config/master.key
32 |
33 | /app/assets/builds/*
34 | !/app/assets/builds/.keep
35 | node_modules
36 | .env
37 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 2,
3 | "useTabs": false,
4 | "bracketSameLine": true,
5 | "printWidth": 100,
6 | "singleAttributePerLine": true,
7 | "proseWrap": "always",
8 | "overrides": [
9 | {
10 | "files": "*.erb",
11 | "options": {
12 | "parser": "html"
13 | }
14 | },
15 | {
16 | "files": "erb",
17 | "options": {
18 | "parser": "html"
19 | }
20 | },
21 | {
22 | "files": "*.html.erb",
23 | "options": {
24 | "parser": "html"
25 | }
26 | },
27 | {
28 | "files": "*.md.html",
29 | "options": {
30 | "parser": "markdown"
31 | }
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | # Omakase Ruby styling for Rails
2 | inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3 |
4 | # Overwrite or add rules to create your own house style
5 | #
6 | # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7 | Layout/SpaceInsideArrayLiteralBrackets:
8 | Enabled: false
9 | Layout/SpaceInsideHashLiteralBraces:
10 | Enabled: false
11 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.3.0
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # syntax = docker/dockerfile:1
2 |
3 | # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4 | ARG RUBY_VERSION=3.3.0
5 | FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6 |
7 | # Rails app lives here
8 | WORKDIR /rails
9 |
10 | # Set production environment
11 | ENV RAILS_ENV="production" \
12 | BUNDLE_DEPLOYMENT="1" \
13 | BUNDLE_PATH="/usr/local/bundle" \
14 | BUNDLE_WITHOUT="development"
15 |
16 |
17 | # Throw-away build stage to reduce size of final image
18 | FROM base as build
19 |
20 | # Install packages needed to build gems
21 | RUN apt-get update -qq && \
22 | apt-get install --no-install-recommends -y build-essential git libvips pkg-config
23 |
24 | # Install application gems
25 | COPY Gemfile Gemfile.lock ./
26 | RUN bundle install && \
27 | rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
28 | bundle exec bootsnap precompile --gemfile
29 |
30 | # Copy application code
31 | COPY . .
32 |
33 | # Precompile bootsnap code for faster boot times
34 | RUN bundle exec bootsnap precompile app/ lib/
35 |
36 | # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
37 | RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
38 |
39 |
40 | # Final stage for app image
41 | FROM base
42 |
43 | # Install packages needed for deployment
44 | RUN apt-get update -qq && \
45 | apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \
46 | rm -rf /var/lib/apt/lists /var/cache/apt/archives
47 |
48 | # Copy built artifacts: gems, application
49 | COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
50 | COPY --from=build /rails /rails
51 |
52 | # Run and own only the runtime files as a non-root user for security
53 | RUN groupadd --system --gid 1000 rails && \
54 | useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
55 | chown -R rails:rails db log storage tmp
56 | USER 1000:1000
57 |
58 | # Entrypoint prepares the database.
59 | ENTRYPOINT ["/rails/bin/docker-entrypoint"]
60 |
61 | # Start the server by default, this can be overwritten at runtime
62 | EXPOSE 3000
63 | CMD ["./bin/rails", "server"]
64 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | ruby "3.3.0"
4 |
5 | # Use main development branch of Rails
6 | gem "rails", github: "rails/rails", branch: "main"
7 |
8 | # The modern asset pipeline for Rails [https://github.com/rails/propshaft]
9 | gem "propshaft"
10 |
11 | # Use sqlite3 as the database for Active Record
12 | gem "sqlite3", "~> 1.4"
13 |
14 | # Use the Puma web server [https://github.com/puma/puma]
15 | gem "puma", ">= 6.0"
16 |
17 | # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
18 | gem "importmap-rails"
19 |
20 | # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
21 | gem "turbo-rails"
22 |
23 | # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
24 | gem "stimulus-rails"
25 |
26 | # Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
27 | gem "tailwindcss-rails"
28 |
29 | # Build JSON APIs with ease [https://github.com/rails/jbuilder]
30 | gem "jbuilder"
31 |
32 | # Use Redis adapter to run Action Cable in production
33 | gem "redis", ">= 4.0.1"
34 |
35 | # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
36 | # gem "kredis"
37 |
38 | # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
39 | # gem "bcrypt", "~> 3.1.7"
40 |
41 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
42 | gem "tzinfo-data", platforms: %i[windows jruby]
43 |
44 | # Reduces boot times through caching; required in config/boot.rb
45 | gem "bootsnap", require: false
46 |
47 | # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
48 | # gem "image_processing", "~> 1.2"
49 |
50 | group :development, :test do
51 | gem "pry"
52 |
53 | # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
54 | gem "rubocop-rails-omakase", require: false
55 | end
56 |
57 | group :development do
58 | # Use console on exceptions pages [https://github.com/rails/web-console]
59 | gem "web-console"
60 |
61 | # Reload the browser when files change
62 | gem "rails_live_reload"
63 |
64 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
65 | # gem "rack-mini-profiler"
66 |
67 | # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
68 | # gem "spring"
69 | end
70 |
71 | # Use Kaminari for pagination
72 | gem "kaminari", github: "kaminari/kaminari", branch: "master"
73 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GIT
2 | remote: https://github.com/kaminari/kaminari.git
3 | revision: 5442f24d1f348a430fb50834d61a356b721875d4
4 | branch: master
5 | specs:
6 | kaminari (1.2.2)
7 | activesupport (>= 4.1.0)
8 | kaminari-actionview (= 1.2.2)
9 | kaminari-activerecord (= 1.2.2)
10 | kaminari-core (= 1.2.2)
11 | kaminari-actionview (1.2.2)
12 | actionview
13 | kaminari-core (= 1.2.2)
14 | kaminari-activerecord (1.2.2)
15 | activerecord
16 | kaminari-core (= 1.2.2)
17 | kaminari-core (1.2.2)
18 |
19 | GIT
20 | remote: https://github.com/rails/rails.git
21 | revision: 0add5dba834f2f1b84fcf1bd1b758545b325fb73
22 | branch: main
23 | specs:
24 | actioncable (7.2.0.alpha)
25 | actionpack (= 7.2.0.alpha)
26 | activesupport (= 7.2.0.alpha)
27 | nio4r (~> 2.0)
28 | websocket-driver (>= 0.6.1)
29 | zeitwerk (~> 2.6)
30 | actionmailbox (7.2.0.alpha)
31 | actionpack (= 7.2.0.alpha)
32 | activejob (= 7.2.0.alpha)
33 | activerecord (= 7.2.0.alpha)
34 | activestorage (= 7.2.0.alpha)
35 | activesupport (= 7.2.0.alpha)
36 | mail (>= 2.8.0)
37 | actionmailer (7.2.0.alpha)
38 | actionpack (= 7.2.0.alpha)
39 | actionview (= 7.2.0.alpha)
40 | activejob (= 7.2.0.alpha)
41 | activesupport (= 7.2.0.alpha)
42 | mail (>= 2.8.0)
43 | rails-dom-testing (~> 2.2)
44 | actionpack (7.2.0.alpha)
45 | actionview (= 7.2.0.alpha)
46 | activesupport (= 7.2.0.alpha)
47 | nokogiri (>= 1.8.5)
48 | racc
49 | rack (>= 2.2.4)
50 | rack-session (>= 1.0.1)
51 | rack-test (>= 0.6.3)
52 | rails-dom-testing (~> 2.2)
53 | rails-html-sanitizer (~> 1.6)
54 | useragent (~> 0.16)
55 | actiontext (7.2.0.alpha)
56 | actionpack (= 7.2.0.alpha)
57 | activerecord (= 7.2.0.alpha)
58 | activestorage (= 7.2.0.alpha)
59 | activesupport (= 7.2.0.alpha)
60 | globalid (>= 0.6.0)
61 | nokogiri (>= 1.8.5)
62 | actionview (7.2.0.alpha)
63 | activesupport (= 7.2.0.alpha)
64 | builder (~> 3.1)
65 | erubi (~> 1.11)
66 | rails-dom-testing (~> 2.2)
67 | rails-html-sanitizer (~> 1.6)
68 | activejob (7.2.0.alpha)
69 | activesupport (= 7.2.0.alpha)
70 | globalid (>= 0.3.6)
71 | activemodel (7.2.0.alpha)
72 | activesupport (= 7.2.0.alpha)
73 | activerecord (7.2.0.alpha)
74 | activemodel (= 7.2.0.alpha)
75 | activesupport (= 7.2.0.alpha)
76 | timeout (>= 0.4.0)
77 | activestorage (7.2.0.alpha)
78 | actionpack (= 7.2.0.alpha)
79 | activejob (= 7.2.0.alpha)
80 | activerecord (= 7.2.0.alpha)
81 | activesupport (= 7.2.0.alpha)
82 | marcel (~> 1.0)
83 | activesupport (7.2.0.alpha)
84 | base64
85 | bigdecimal
86 | concurrent-ruby (~> 1.0, >= 1.0.2)
87 | connection_pool (>= 2.2.5)
88 | drb
89 | i18n (>= 1.6, < 2)
90 | minitest (>= 5.1)
91 | tzinfo (~> 2.0, >= 2.0.5)
92 | rails (7.2.0.alpha)
93 | actioncable (= 7.2.0.alpha)
94 | actionmailbox (= 7.2.0.alpha)
95 | actionmailer (= 7.2.0.alpha)
96 | actionpack (= 7.2.0.alpha)
97 | actiontext (= 7.2.0.alpha)
98 | actionview (= 7.2.0.alpha)
99 | activejob (= 7.2.0.alpha)
100 | activemodel (= 7.2.0.alpha)
101 | activerecord (= 7.2.0.alpha)
102 | activestorage (= 7.2.0.alpha)
103 | activesupport (= 7.2.0.alpha)
104 | bundler (>= 1.15.0)
105 | railties (= 7.2.0.alpha)
106 | railties (7.2.0.alpha)
107 | actionpack (= 7.2.0.alpha)
108 | activesupport (= 7.2.0.alpha)
109 | irb
110 | rackup (>= 1.0.0)
111 | rake (>= 12.2)
112 | thor (~> 1.0, >= 1.2.2)
113 | zeitwerk (~> 2.6)
114 |
115 | GEM
116 | remote: https://rubygems.org/
117 | specs:
118 | ast (2.4.2)
119 | base64 (0.2.0)
120 | bigdecimal (3.1.6)
121 | bindex (0.8.1)
122 | bootsnap (1.18.3)
123 | msgpack (~> 1.2)
124 | builder (3.2.4)
125 | coderay (1.1.3)
126 | concurrent-ruby (1.2.3)
127 | connection_pool (2.4.1)
128 | crass (1.0.6)
129 | date (3.3.4)
130 | drb (2.2.0)
131 | ruby2_keywords
132 | erubi (1.12.0)
133 | ffi (1.16.3)
134 | globalid (1.2.1)
135 | activesupport (>= 6.1)
136 | i18n (1.14.1)
137 | concurrent-ruby (~> 1.0)
138 | importmap-rails (2.0.1)
139 | actionpack (>= 6.0.0)
140 | activesupport (>= 6.0.0)
141 | railties (>= 6.0.0)
142 | io-console (0.7.2)
143 | irb (1.11.1)
144 | rdoc
145 | reline (>= 0.4.2)
146 | jbuilder (2.11.5)
147 | actionview (>= 5.0.0)
148 | activesupport (>= 5.0.0)
149 | json (2.7.1)
150 | language_server-protocol (3.17.0.3)
151 | listen (3.8.0)
152 | rb-fsevent (~> 0.10, >= 0.10.3)
153 | rb-inotify (~> 0.9, >= 0.9.10)
154 | loofah (2.22.0)
155 | crass (~> 1.0.2)
156 | nokogiri (>= 1.12.0)
157 | mail (2.8.1)
158 | mini_mime (>= 0.1.1)
159 | net-imap
160 | net-pop
161 | net-smtp
162 | marcel (1.0.2)
163 | method_source (1.0.0)
164 | mini_mime (1.1.5)
165 | minitest (5.21.2)
166 | msgpack (1.7.2)
167 | net-imap (0.4.9.1)
168 | date
169 | net-protocol
170 | net-pop (0.1.2)
171 | net-protocol
172 | net-protocol (0.2.2)
173 | timeout
174 | net-smtp (0.4.0.1)
175 | net-protocol
176 | nio4r (2.7.0)
177 | nokogiri (1.16.2-aarch64-linux)
178 | racc (~> 1.4)
179 | nokogiri (1.16.2-arm-linux)
180 | racc (~> 1.4)
181 | nokogiri (1.16.2-arm64-darwin)
182 | racc (~> 1.4)
183 | nokogiri (1.16.2-x86-linux)
184 | racc (~> 1.4)
185 | nokogiri (1.16.2-x86_64-darwin)
186 | racc (~> 1.4)
187 | nokogiri (1.16.2-x86_64-linux)
188 | racc (~> 1.4)
189 | parallel (1.24.0)
190 | parser (3.3.0.5)
191 | ast (~> 2.4.1)
192 | racc
193 | propshaft (0.8.0)
194 | actionpack (>= 7.0.0)
195 | activesupport (>= 7.0.0)
196 | rack
197 | railties (>= 7.0.0)
198 | pry (0.14.2)
199 | coderay (~> 1.1)
200 | method_source (~> 1.0)
201 | psych (5.1.2)
202 | stringio
203 | puma (6.4.2)
204 | nio4r (~> 2.0)
205 | racc (1.7.3)
206 | rack (3.0.9)
207 | rack-session (2.0.0)
208 | rack (>= 3.0.0)
209 | rack-test (2.1.0)
210 | rack (>= 1.3)
211 | rackup (2.1.0)
212 | rack (>= 3)
213 | webrick (~> 1.8)
214 | rails-dom-testing (2.2.0)
215 | activesupport (>= 5.0.0)
216 | minitest
217 | nokogiri (>= 1.6)
218 | rails-html-sanitizer (1.6.0)
219 | loofah (~> 2.21)
220 | nokogiri (~> 1.14)
221 | rails_live_reload (0.3.5)
222 | listen
223 | nio4r
224 | railties
225 | websocket-driver
226 | rainbow (3.1.1)
227 | rake (13.1.0)
228 | rb-fsevent (0.11.2)
229 | rb-inotify (0.10.1)
230 | ffi (~> 1.0)
231 | rdoc (6.6.2)
232 | psych (>= 4.0.0)
233 | redis (5.0.8)
234 | redis-client (>= 0.17.0)
235 | redis-client (0.19.1)
236 | connection_pool
237 | regexp_parser (2.9.0)
238 | reline (0.4.2)
239 | io-console (~> 0.5)
240 | rexml (3.2.6)
241 | rubocop (1.60.2)
242 | json (~> 2.3)
243 | language_server-protocol (>= 3.17.0)
244 | parallel (~> 1.10)
245 | parser (>= 3.3.0.2)
246 | rainbow (>= 2.2.2, < 4.0)
247 | regexp_parser (>= 1.8, < 3.0)
248 | rexml (>= 3.2.5, < 4.0)
249 | rubocop-ast (>= 1.30.0, < 2.0)
250 | ruby-progressbar (~> 1.7)
251 | unicode-display_width (>= 2.4.0, < 3.0)
252 | rubocop-ast (1.30.0)
253 | parser (>= 3.2.1.0)
254 | rubocop-minitest (0.34.5)
255 | rubocop (>= 1.39, < 2.0)
256 | rubocop-ast (>= 1.30.0, < 2.0)
257 | rubocop-performance (1.20.2)
258 | rubocop (>= 1.48.1, < 2.0)
259 | rubocop-ast (>= 1.30.0, < 2.0)
260 | rubocop-rails (2.23.1)
261 | activesupport (>= 4.2.0)
262 | rack (>= 1.1)
263 | rubocop (>= 1.33.0, < 2.0)
264 | rubocop-ast (>= 1.30.0, < 2.0)
265 | rubocop-rails-omakase (1.0.0)
266 | rubocop
267 | rubocop-minitest
268 | rubocop-performance
269 | rubocop-rails
270 | ruby-progressbar (1.13.0)
271 | ruby2_keywords (0.0.5)
272 | sqlite3 (1.7.2-aarch64-linux)
273 | sqlite3 (1.7.2-arm-linux)
274 | sqlite3 (1.7.2-arm64-darwin)
275 | sqlite3 (1.7.2-x86-linux)
276 | sqlite3 (1.7.2-x86_64-darwin)
277 | sqlite3 (1.7.2-x86_64-linux)
278 | stimulus-rails (1.3.3)
279 | railties (>= 6.0.0)
280 | stringio (3.1.0)
281 | tailwindcss-rails (2.3.0)
282 | railties (>= 6.0.0)
283 | tailwindcss-rails (2.3.0-aarch64-linux)
284 | railties (>= 6.0.0)
285 | tailwindcss-rails (2.3.0-arm-linux)
286 | railties (>= 6.0.0)
287 | tailwindcss-rails (2.3.0-arm64-darwin)
288 | railties (>= 6.0.0)
289 | tailwindcss-rails (2.3.0-x86_64-darwin)
290 | railties (>= 6.0.0)
291 | tailwindcss-rails (2.3.0-x86_64-linux)
292 | railties (>= 6.0.0)
293 | thor (1.3.0)
294 | timeout (0.4.1)
295 | turbo-rails (1.5.0)
296 | actionpack (>= 6.0.0)
297 | activejob (>= 6.0.0)
298 | railties (>= 6.0.0)
299 | tzinfo (2.0.6)
300 | concurrent-ruby (~> 1.0)
301 | unicode-display_width (2.5.0)
302 | useragent (0.16.10)
303 | web-console (4.2.1)
304 | actionview (>= 6.0.0)
305 | activemodel (>= 6.0.0)
306 | bindex (>= 0.4.0)
307 | railties (>= 6.0.0)
308 | webrick (1.8.1)
309 | websocket-driver (0.7.6)
310 | websocket-extensions (>= 0.1.0)
311 | websocket-extensions (0.1.5)
312 | zeitwerk (2.6.12)
313 |
314 | PLATFORMS
315 | aarch64-linux
316 | arm-linux
317 | arm64-darwin
318 | x86-linux
319 | x86_64-darwin
320 | x86_64-linux
321 |
322 | DEPENDENCIES
323 | bootsnap
324 | importmap-rails
325 | jbuilder
326 | kaminari!
327 | propshaft
328 | pry
329 | puma (>= 6.0)
330 | rails!
331 | rails_live_reload
332 | redis (>= 4.0.1)
333 | rubocop-rails-omakase
334 | sqlite3 (~> 1.4)
335 | stimulus-rails
336 | tailwindcss-rails
337 | turbo-rails
338 | tzinfo-data
339 | web-console
340 |
341 | RUBY VERSION
342 | ruby 3.3.0p0
343 |
344 | BUNDLED WITH
345 | 2.5.3
346 |
--------------------------------------------------------------------------------
/Procfile.dev:
--------------------------------------------------------------------------------
1 | web: bin/rails server
2 | css: bin/rails tailwindcss:watch
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Turbo Sortable Paginated Table
2 |
3 | [Read the Full Article](https://code.avi.nyc/turbo-sortable-paginated-tables)
4 |
5 | We're going to build a common UI pattern: a sortable, paginated table using the power of Ruby on Rails and Turbo Frames.
6 |
7 | ## Sortable Table Headers
8 |
9 | The first step is to create the sortable table headers as simple links. I wrote a few helper methods in Ruby to make this easier.
10 |
11 | ```ruby
12 | module ApplicationHelper
13 | def sortable_table_header(title, column, path_method, **)
14 | content_tag(:th, class: "invoices__th") do
15 | sortable_column(title, column, path_method)
16 | end
17 | end
18 |
19 | def sortable_column(title, column, path_method, **)
20 | direction = (column.to_s == params[:sort].to_s && params[:direction] == "asc") ? "desc" : "asc"
21 |
22 | query_params = request.query_parameters.merge(sort: column, direction: direction)
23 |
24 | path = send(path_method, query_params)
25 | link_to(path, class: "flex items-center", **) do
26 | concat title
27 | concat sort_icon(column)
28 | end
29 | end
30 |
31 | def sort_icon(column)
32 | return unless params[:sort].to_s == column.to_s
33 |
34 | if params[:direction] == "asc"
35 | svg_icon("M5 15l7-7 7 7")
36 | else
37 | svg_icon("M19 9l-7 7-7-7")
38 | end
39 | end
40 |
41 | def svg_icon(path_d)
42 | content_tag(:svg, xmlns: "http://www.w3.org/2000/svg", class: "ml-1 inline w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor") do
43 | " ".html_safe
44 | end
45 | end
46 | end
47 | ```
48 |
49 | The important one is `sortable_column` which creates the link to with the sort and direction query parameters. With that method, we can make each table header a link to sort the table by that column, alternating between ascending and descending order. In our main view, we can use it like this:
50 |
51 | ```erb
52 |
53 |
54 | <%= sortable_table_header 'ID', :id, :invoices_path, class: 'invoices__row--header' %>
55 | <%= sortable_table_header 'Amount', :amount, :invoices_path, class: 'invoices__row--header' %>
56 | <%= sortable_table_header 'Status', :status, :invoices_path, class: 'invoices__row--header' %>
57 | <%= sortable_table_header 'Created At', :created_at, :invoices_path, class: 'invoices__row--header' %>
58 |
59 |
60 | ```
61 |
62 | Now when you click on a column header, the table will be sorted by that column by making a full request to the server and redrawing the entire page, you know, the way links work out of the box. We'd also have to update our controller code to support the sort and direction params, so let's do that.
63 |
64 | ```ruby
65 | class InvoicesController < ApplicationController
66 | def index
67 | sort_column = params[:sort] || "created_at"
68 | sort_direction = params[:direction].presence_in(%w[asc desc]) || "desc"
69 |
70 | @invoices = Invoice.order("#{sort_column} #{sort_direction}").page(params[:page]).per(10)
71 | end
72 | end
73 | ```
74 |
75 | I'm using the [kaminari](https://github.com/kaminari/kaminari) gem for pagination, so I'm using the `page` and `per` methods to paginate the results. The `order` method is used to sort the results by the column and direction specified in the query parameters. It works pretty well out of the box.
76 |
77 | 
78 |
79 | This is the nice, classic, beauty of Ruby on Rails. Clean backend code written in Ruby to do the heavy lifting, and simple, clean HTML to render the table.
80 |
81 | The only issue is that as you can see, every time we click on a column header, the browser is redrawing the entire page. Notice the `html`, `head`, and `body` tag being updated?
82 |
83 | That means that any other content on the page that won't need to be updated from the new request is redrawn anyway.
84 |
85 | In the spirit of reactive applications, we want to alter the dom as little as possible to keep the user experience smooth and fast and only redraw the updated part of the page, the table. That's where Turbo Frames come in.
86 |
87 | ## Turbo Frame Table
88 |
89 | We're going to wrap the entire table in a turbo frame. A turbo frame is a container that can be updated without a full page reload. It's a way to make a part of the page reactive, but without the complexity of a frontend framework or even any change to our backend at all.
90 |
91 | ```erb
92 | <%= turbo_frame_tag "invoices" do %>
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | <%= sortable_table_header 'ID', :id, :invoices_path, class: 'invoices__row--header' %>
101 | <%= sortable_table_header 'Amount', :amount, :invoices_path, class: 'invoices__row--header' %>
102 | <%= sortable_table_header 'Status', :status, :invoices_path, class: 'invoices__row--header' %>
103 | <%= sortable_table_header 'Created At', :created_at, :invoices_path, class: 'invoices__row--header' %>
104 |
105 |
106 |
107 | <% @invoices.each do |invoice| %>
108 |
109 |
110 | <%= invoice.id %>
111 |
112 |
113 | <%= number_to_currency(invoice.amount) %>
114 |
115 |
116 | <%= status_badge(invoice.status) %>
117 |
118 |
119 | <%= invoice.created_at.strftime('%m/%d/%Y') %>
120 |
121 |
122 | <% end %>
123 |
124 |
125 |
126 |
127 |
128 | <%= paginate @invoices %>
129 |
130 | <% end %>
131 | ```
132 |
133 | The cool thing is that any link within the turbo frame when clicked will automatically change the source property of its parent frame to the href of the link. This means that when we click on a sortable column header, the turbo frame will automatically update itself with the new sorted table. No need to write any JavaScript or even any additional backend code. It just works.
134 |
135 | 
136 |
137 | With the update, the browser is no longer redrawing the entire page. It's only redrawing the turbo frame, which is the table. This makes the user experience much smoother and faster and means any other content on the page will be maintained and not rerendered or anything. It's just way less work for the browser.
138 |
139 | That's really it. The only issue is that clicking on a column header doesn't change the URL, so you can't share the state of the sorted table with anyone. But fixing that is easy with Turbo. By adding a [`data-turbo-action="advance"`](https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit) attribute to the link, we can change the URL without a full page reload, essentially advancing the page state to the new sorted table URL, but only redrawing the turbo frame.
140 |
141 | I updated the `sortable_column` method to include the `data-turbo-action` attribute.
142 |
143 | ```ruby
144 | def sortable_column(title, column, path_method, **)
145 | direction = (column.to_s == params[:sort].to_s && params[:direction] == "asc") ? "desc" : "asc"
146 |
147 | query_params = request.query_parameters.merge(sort: column, direction: direction)
148 |
149 | path = send(path_method, query_params)
150 | link_to(path, data: {turbo_action: "advance"}, class: "flex items-center", **) do
151 | concat title
152 | concat sort_icon(column)
153 | end
154 | end
155 | ```
156 |
157 | With that we can see that the URL changes when we click on a column header, but only the table is redrawn.
158 |
159 | 
160 |
161 | Now you can share the state of the sort with people.
162 |
163 | ## Conclusion
164 |
165 | I wish there was more to say about implementing this feature, it's just so simple and easy to do with Turbo and Rails. I also updated the pagination links to use the `data-turbo-action="advance"` attribute so that the URL changes when you click on a page number, but only the table is redrawn.
166 |
167 | The rest of the code in the application is worth exploring for some nice `BEM` and `Tailwind` patterns, but the main feature is the sortable, paginated table. Checkout the final source:
168 |
169 | - [Sortable Table Helper](https://github.com/aviflombaum/turbo-sortable-paginated-tables/blob/main/app/helpers/application_helper.rb)
170 | - [Sortable Table View](https://github.com/aviflombaum/turbo-sortable-paginated-tables/blob/main/app/views/invoices/index.html.erb)
171 | - [Sortable Table Controller](https://github.com/aviflombaum/turbo-sortable-paginated-tables/blob/main/app/controllers/invoices_controller.rb)
172 | - [Kaminari Pagination for Tailwind](https://github.com/aviflombaum/turbo-sortable-paginated-tables/tree/main/app/views/kaminari)
173 | - [BEM Style Tailwind CSS Tables](https://github.com/aviflombaum/turbo-sortable-paginated-tables/blob/main/app/assets/stylesheets/application.tailwind.css#L79-L116)
174 |
175 | You can checkout the full source code [Github](https://github.com/aviflombaum/turbo-sortable-paginated-tables) and play with it at [Turbo Sortable Paginated Tables](https://avi.nyc/turbo-sortable-paginated-tables).
176 |
177 | If you have any questions or comments or just liked the demo, feel free to reach out to me on [X](https://twitter.com/aviflombaum).
178 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/assets/builds/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/app/assets/builds/.keep
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/app/assets/images/.keep
--------------------------------------------------------------------------------
/app/assets/images/rails-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/app/assets/images/rails-logo.png
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /* Application styles */
2 |
3 | .heart {
4 | color: #e00;
5 | animation: beat 0.45s infinite alternate;
6 | transform-origin: center;
7 | display: inline-block;
8 | }
9 |
10 | @keyframes beat {
11 | to {
12 | transform: scale(1.2);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.tailwind.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | @layer components {
6 | main {
7 | @apply w-full max-w-2xl mx-auto mt-12 md:w-2/3;
8 | }
9 |
10 | h1 {
11 | @apply text-4xl font-bold;
12 | }
13 |
14 | form {
15 | @apply my-8;
16 | }
17 |
18 | fieldset {
19 | @apply my-4;
20 | }
21 |
22 | input[type="text"],
23 | textarea {
24 | @apply block w-full px-3 py-2 border border-gray-200 rounded-md shadow outline-none;
25 | }
26 |
27 | button,
28 | .btn,
29 | a.btn {
30 | @apply inline-block px-5 py-3 font-medium bg-gray-100 rounded-lg;
31 | }
32 |
33 | .btn-primary,
34 | input[type="submit"] {
35 | @apply inline-block px-5 py-3 font-medium text-white bg-blue-600 rounded-lg cursor-pointer;
36 | }
37 |
38 | #error_explanation {
39 | @apply px-3 py-2 mt-3 font-medium text-red-500 rounded-lg bg-red-50;
40 | }
41 |
42 | .paginator {
43 | @apply items-center w-full py-4 text-sm bg-white sm:flex sm:justify-between;
44 |
45 | .paginator__next {
46 | @apply flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700;
47 | }
48 |
49 | .paginator__prev {
50 | @apply flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700;
51 | }
52 | .paginator__gap {
53 | @apply flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300;
54 | }
55 |
56 | .paginator__page {
57 | @apply flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700;
58 | }
59 | .paginator__page-current {
60 | @apply text-indigo-600 bg-indigo-100 hover:bg-indigo-200 hover:text-indigo-700;
61 | }
62 |
63 | .paginator__page-first {
64 | @apply rounded-s-lg;
65 | }
66 |
67 | .paginator__page-last {
68 | @apply rounded-e-lg;
69 | }
70 | }
71 | }
72 |
73 | .invoices {
74 | @apply px-4 sm:px-6 lg:px-8;
75 |
76 | .invoices__header {
77 | @apply text-base font-semibold leading-6 text-gray-900;
78 | }
79 |
80 | .invoices__table {
81 | @apply min-w-full divide-y divide-gray-300;
82 | }
83 |
84 | .invoices__thead {
85 | @apply bg-gray-50;
86 | }
87 |
88 | .invoices__th {
89 | @apply px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase;
90 | }
91 | .invoices__tbody {
92 | @apply bg-white divide-y divide-gray-200;
93 | }
94 |
95 | .invoices__row {
96 | @apply py-4 pl-4 pr-3 text-sm text-gray-500 sm:pl-6 whitespace-nowrap;
97 | }
98 |
99 | .invoices__row--header {
100 | @apply px-3;
101 | }
102 |
103 | .invoices__row--id {
104 | @apply font-medium text-gray-900;
105 | }
106 |
107 | .invoices__table--shadow {
108 | @apply overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3 | allow_browser versions: :modern
4 |
5 | def welcome
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/app/controllers/invoices_controller.rb:
--------------------------------------------------------------------------------
1 | class InvoicesController < ApplicationController
2 | def index
3 | sort_column = params[:sort] || "created_at"
4 | sort_direction = params[:direction].presence_in(%w[asc desc]) || "desc"
5 |
6 | @invoices = Invoice.order("#{sort_column} #{sort_direction}").page(params[:page]).per(10)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | def sortable_table_header(title, column, path_method, **)
3 | content_tag(:th, class: "invoices__th") do
4 | sortable_column(title, column, path_method)
5 | end
6 | end
7 |
8 | def sortable_column(title, column, path_method, **)
9 | direction = (column.to_s == params[:sort].to_s && params[:direction] == "asc") ? "desc" : "asc"
10 |
11 | query_params = request.query_parameters.merge(sort: column, direction: direction)
12 |
13 | path = send(path_method, query_params)
14 | link_to(path, data: {turbo_action: "advance"}, class: "flex items-center", **) do
15 | concat title
16 | concat sort_icon(column)
17 | end
18 | end
19 |
20 | def sort_icon(column)
21 | return unless params[:sort].to_s == column.to_s
22 |
23 | if params[:direction] == "asc"
24 | svg_icon("M5 15l7-7 7 7")
25 | else
26 | svg_icon("M19 9l-7 7-7-7")
27 | end
28 | end
29 |
30 | def svg_icon(path_d)
31 | content_tag(:svg, xmlns: "http://www.w3.org/2000/svg", class: "ml-1 inline w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor") do
32 | " ".html_safe
33 | end
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/app/helpers/invoices_helper.rb:
--------------------------------------------------------------------------------
1 | module InvoicesHelper
2 | def status_badge(status)
3 | case status
4 | when "Cancelled"
5 | content_tag(:span, "Cancelled", class: "inline-flex px-2 text-xs font-semibold leading-5 text-red-800 bg-red-100 rounded-full")
6 | when "Refunded"
7 | content_tag(:span, "Refunded", class: "inline-flex px-2 text-xs font-semibold leading-5 text-yellow-800 bg-yellow-100 rounded-full")
8 | when "Completed"
9 | content_tag(:span, "Completed", class: "inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full")
10 | else
11 | content_tag(:span, status, class: "inline-flex px-2 text-xs font-semibold leading-5 text-gray-800 bg-gray-100 rounded-full")
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/app/helpers/posts/tags_helper.rb:
--------------------------------------------------------------------------------
1 | module Posts::TagsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/javascript/application.js:
--------------------------------------------------------------------------------
1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2 | import "@hotwired/turbo-rails"
3 | import "controllers"
4 |
--------------------------------------------------------------------------------
/app/javascript/controllers/application.js:
--------------------------------------------------------------------------------
1 | import { Application } from "@hotwired/stimulus"
2 |
3 | const application = Application.start()
4 |
5 | // Configure Stimulus development experience
6 | application.debug = false
7 | window.Stimulus = application
8 |
9 | export { application }
10 |
--------------------------------------------------------------------------------
/app/javascript/controllers/focus_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus";
2 |
3 | export default class extends Controller {
4 | static values = { focus: String };
5 |
6 | connect() {
7 | if (this.focusValue == "now") {
8 | this.element.focus();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/javascript/controllers/hello_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus"
2 |
3 | export default class extends Controller {
4 | connect() {
5 | this.element.textContent = "Hello World!"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/app/javascript/controllers/index.js:
--------------------------------------------------------------------------------
1 | // Import and register all your controllers from the importmap under controllers/*
2 |
3 | import { application } from "controllers/application"
4 |
5 | // Eager load all controllers defined in the import map under controllers/**/*_controller
6 | import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7 | eagerLoadControllersFrom("controllers", application)
8 |
9 | // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10 | // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11 | // lazyLoadControllersFrom("controllers", application)
12 |
--------------------------------------------------------------------------------
/app/javascript/controllers/remove_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus";
2 |
3 | export default class extends Controller {
4 | static targets = ["element"];
5 |
6 | connect() {}
7 |
8 | remove(e) {
9 | e.preventDefault();
10 | this.elementTarget.classList.add("animate-fade-out");
11 | setTimeout(() => this.elementTarget.remove(), 200);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/app/models/concerns/.keep
--------------------------------------------------------------------------------
/app/models/invoice.rb:
--------------------------------------------------------------------------------
1 | class Invoice < ApplicationRecord
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/application/welcome.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 | <%= image_tag "rails-logo.png", class: "mx-auto" %>
9 |
avi.nyc
10 | ♥
11 | Rails
12 |
A barebones base Ruby on Rails application template.
13 |
14 |
15 | Riding Rails <%= Rails.version %> on Ruby <%= RUBY_VERSION %> in <%= Rails.env %> on host
16 | <%= RbConfig::CONFIG['host_os'] %>
17 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/views/invoices/index.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :title, "Turbo Sortable Paginated Tables" %>
2 |
3 |
4 |
9 | <%= turbo_frame_tag "invoices" do %>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | <%= sortable_table_header 'ID', :id, :invoices_path, class: 'invoices__row--header' %>
18 | <%= sortable_table_header 'Amount', :amount, :invoices_path, class: 'invoices__row--header' %>
19 | <%= sortable_table_header 'Status', :status, :invoices_path, class: 'invoices__row--header' %>
20 | <%= sortable_table_header 'Created At', :created_at, :invoices_path, class: 'invoices__row--header' %>
21 |
22 |
23 |
24 | <% @invoices.each do |invoice| %>
25 |
26 |
27 | <%= invoice.id %>
28 |
29 |
30 | <%= number_to_currency(invoice.amount) %>
31 |
32 |
33 | <%= status_badge(invoice.status) %>
34 |
35 |
36 | <%= invoice.created_at.strftime('%m/%d/%Y') %>
37 |
38 |
39 | <% end %>
40 |
41 |
42 |
43 |
44 |
45 | <%= paginate @invoices %>
46 |
47 | <% end %>
48 |
49 |
--------------------------------------------------------------------------------
/app/views/kaminari/_first_page.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, data: {turbo_action: "advance"} %>
3 |
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_gap.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= t('views.pagination.truncate').html_safe %>
3 |
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_last_page.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, data: {turbo_action: "advance"} %>
3 |
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_next_page.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Next
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/views/kaminari/_page.html.erb:
--------------------------------------------------------------------------------
1 | <% if page.current? %>
2 |
3 | <%= "paginator__page-last" if current_page.last? %>"
4 | data-turbo-action="advance">
5 | <%= page %>
6 |
7 |
8 | <% else %>
9 |
10 |
12 | <%= page %>
13 |
14 |
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/kaminari/_paginator.html.erb:
--------------------------------------------------------------------------------
1 | <%= paginator.render do -%>
2 |
3 |
4 |
5 | Showing
6 |
7 | <%= current_page.first? ? "1" : ((current_page.to_i - 1) * per_page) + 1 %>
8 |
9 | to
10 |
11 | <%= current_page.to_i * per_page %>
12 |
13 | of
14 |
15 | <%= total_pages * per_page %>
16 |
17 |
18 |
19 |
20 | <%= prev_page_tag unless current_page.first? %>
21 | <% each_page do |page| -%>
22 | <% if page.display_tag? -%>
23 | <%= page_tag page %>
24 | <% elsif !page.was_truncated? -%>
25 | <%= gap_tag %>
26 | <% end -%>
27 | <% end -%>
28 | <% unless current_page.out_of_range? %>
29 | <%= next_page_tag unless current_page.last? %>
30 | <% end %>
31 |
32 |
33 | <% end -%>
34 |
--------------------------------------------------------------------------------
/app/views/kaminari/_prev_page.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
4 | Previous
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/layouts/_footer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
avi.nyc
5 |
❤️
6 |
Rails
7 |
8 |
9 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= content_for(:title) || "avi.nyc ❤️ Rails" %>
5 |
6 |
7 | <%= csrf_meta_tags %>
8 | <%= csp_meta_tag %>
9 |
10 | <%= yield :head %>
11 |
12 |
13 |
14 |
15 |
16 | <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
17 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
18 | <%= javascript_importmap_tags %>
19 |
20 |
21 |
22 |
23 |
24 |
25 | <%= yield %>
26 |
27 |
28 | <%= render "layouts/footer" %>
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/views/pwa/manifest.json.erb:
--------------------------------------------------------------------------------
1 | {
2 | "name": "avi.nyc ❤️ Rails",
3 | "icons": [
4 | {
5 | "src": "/android-chrome-192x192.png",
6 | "sizes": "192x192",
7 | "type": "image/png"
8 | },
9 | {
10 | "src": "/android-chrome-512x512.png",
11 | "sizes": "512x512",
12 | "type": "image/png"
13 | }
14 | ],
15 | "start_url": "/",
16 | "display": "standalone",
17 | "scope": "/",
18 | "description": "avi.nyc ❤️ Rails",
19 | "theme_color": "#ffffff",
20 | "background_color": "#ffffff"
21 | }
22 |
--------------------------------------------------------------------------------
/app/views/pwa/service-worker.js:
--------------------------------------------------------------------------------
1 | // Add a service worker for processing Web Push notifications:
2 | //
3 | // self.addEventListener("push", async (event) => {
4 | // const { title, options } = await event.data.json()
5 | // event.waitUntil(self.registration.showNotification(title, options))
6 | // })
7 | //
8 | // self.addEventListener("notificationclick", function(event) {
9 | // event.notification.close()
10 | // event.waitUntil(
11 | // clients.matchAll({ type: "window" }).then((clientList) => {
12 | // for (let i = 0; i < clientList.length; i++) {
13 | // let client = clientList[i]
14 | // let clientPath = (new URL(client.url)).pathname
15 | //
16 | // if (clientPath == event.notification.data.path && "focus" in client) {
17 | // return client.focus()
18 | // }
19 | // }
20 | //
21 | // if (clients.openWindow) {
22 | // return clients.openWindow(event.notification.data.path)
23 | // }
24 | // })
25 | // )
26 | // })
27 |
--------------------------------------------------------------------------------
/bin/brakeman:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | ARGV.unshift("--ensure-latest")
6 |
7 | load Gem.bin_path("brakeman", "brakeman")
8 |
--------------------------------------------------------------------------------
/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.match?(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
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", __dir__)
45 | end
46 |
47 | def lockfile
48 | lockfile =
49 | case File.basename(gemfile)
50 | when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
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_requirement
64 | @bundler_requirement ||=
65 | env_var_version ||
66 | cli_arg_version ||
67 | bundler_requirement_for(lockfile_version)
68 | end
69 |
70 | def bundler_requirement_for(version)
71 | return "#{Gem::Requirement.default}.a" unless version
72 |
73 | bundler_gem_version = Gem::Version.new(version)
74 |
75 | bundler_gem_version.approximate_recommendation
76 | end
77 |
78 | def load_bundler!
79 | ENV["BUNDLE_GEMFILE"] ||= gemfile
80 |
81 | activate_bundler
82 | end
83 |
84 | def activate_bundler
85 | gem_error = activation_error_handling do
86 | gem "bundler", bundler_requirement
87 | end
88 | return if gem_error.nil?
89 | require_error = activation_error_handling do
90 | require "bundler/version"
91 | end
92 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
93 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94 | exit 42
95 | end
96 |
97 | def activation_error_handling
98 | yield
99 | nil
100 | rescue StandardError, LoadError => e
101 | e
102 | end
103 | end
104 |
105 | m.load_bundler!
106 |
107 | if m.invoked_as_script?
108 | load Gem.bin_path("bundler", "bundle")
109 | end
110 |
--------------------------------------------------------------------------------
/bin/debug:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | overmind connect web
4 |
--------------------------------------------------------------------------------
/bin/deploy:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'dotenv'
3 | require 'json'
4 | require 'pry'
5 |
6 | Dotenv.load
7 |
8 | id = JSON.parse(`curl -s -X POST https://app.hatchbox.io/webhooks/deployments/#{ENV["HATCHBOX_DEPLOY_KEY"]}?latest=true`)["id"]
9 |
10 | puts "Deployment started: https://app.hatchbox.io/apps/#{ENV["HATCHBOX_APP_ID"]}/logs/#{id}"
11 |
--------------------------------------------------------------------------------
/bin/dev:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | # Default to port 3000 if not specified
4 | export PORT="${PORT:-3000}"
5 |
6 | # Let the debug gem allow remote connections,
7 | # but avoid loading until `debugger` is called
8 | export RUBY_DEBUG_OPEN="true"
9 | export RUBY_DEBUG_LAZY="true"
10 |
11 | # Check if overmind is installed
12 | if command -v overmind &> /dev/null; then
13 | echo "Starting with overmind..."
14 | overmind start -f Procfile.dev "$@"
15 | else
16 | # Check if foreman is installed
17 | if ! command -v foreman &> /dev/null; then
18 | echo "Installing foreman..."
19 | gem install foreman
20 | fi
21 | echo "Starting with foreman..."
22 | foreman start -f Procfile.dev "$@"
23 | fi
24 |
--------------------------------------------------------------------------------
/bin/docker-entrypoint:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # If running the rails server then create or migrate existing database
4 | if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
5 | ./bin/rails db:prepare
6 | fi
7 |
8 | exec "${@}"
9 |
--------------------------------------------------------------------------------
/bin/importmap:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require_relative "../config/application"
4 | require "importmap/commands"
5 |
--------------------------------------------------------------------------------
/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/rubocop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | # explicit rubocop config increases performance slightly while avoiding config confusion.
6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7 |
8 | load Gem.bin_path("rubocop", "rubocop")
9 |
--------------------------------------------------------------------------------
/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, exception: true)
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time 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 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/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 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/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 "rails/test_unit/railtie"
16 |
17 | # Require the gems listed in Gemfile, including any gems
18 | # you've limited to :test, :development, or :production.
19 | Bundler.require(*Rails.groups)
20 |
21 | module DemoApp
22 | class Application < Rails::Application
23 | # Initialize configuration defaults for originally generated Rails version.
24 | config.load_defaults 7.2
25 |
26 | # Please, add to the `ignore` list any other `lib` subdirectories that do
27 | # not contain `.rb` files, or that should not be reloaded or eager loaded.
28 | # Common ones are `templates`, `generators`, or `middleware`, for example.
29 | config.autoload_lib(ignore: %w[assets tasks])
30 |
31 | # Configuration for the application, engines, and railties goes here.
32 | #
33 | # These settings can be overridden in specific environments using the files
34 | # in config/environments, which are processed later.
35 | #
36 | # config.time_zone = "Central Time (US & Canada)"
37 | # config.eager_load_paths << Rails.root.join("extras")
38 |
39 | # Don't generate system test files.
40 | config.generators.system_tests = nil
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/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: redis
3 | url: redis://localhost:6379/1
4 |
5 | test:
6 | adapter: test
7 |
8 | production:
9 | adapter: redis
10 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
11 | channel_prefix: article_template_production
12 |
--------------------------------------------------------------------------------
/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | bpMAftQ5/YKDq66tquDsrTJizFzRpFRiG0QxIvegQVvuAWtrkU5XfVIjQ2qTU/oRTUElk/PwRaZFydoqAARlL9CuoBULtYOamFqKezYarLRfaQI7WAjJseWLQKofXoTj1z2upf6mQYqPOt8nEwM6JrNGcujYjhd8R8paJJMn2qug3RE7hYs7hZvVlcMENRWyHBKAOb8FHiCApPgLu/5Ku1nddONIacJ2My+L23b0OPRViUQU8R2BilfHqWHuQ5TjBrxaJVg/xn9mlfSLQhVuejGrHdELkWA+SIBx+heCcQPZdz1wVvKCvXqKv4ze3Erd7Hbw76ArwGZNdIlNZJ/6Jt1JcPFkAGqR+HRcUIvNeseeQjXIIo24g5aeXokNe+A2gJO9Uv4iL+NOCq3JXEgALijOo7eu--G3O2qba3rWSE0WDS--Fbe6n+S8jIvNFuS/x0Ta+g==
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite. Versions 3.8.0 and up are supported.
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem "sqlite3"
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: storage/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: storage/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: storage/production.sqlite3
26 |
--------------------------------------------------------------------------------
/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 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # In the development environment your application's code is reloaded any time
7 | # it changes. This slows down response time but is perfect for development
8 | # since you don't have to restart the web server when you make code changes.
9 | config.enable_reloading = true
10 |
11 | # Do not eager load code on boot.
12 | config.eager_load = false
13 |
14 | # Show full error reports.
15 | config.consider_all_requests_local = true
16 |
17 | # Enable server timing
18 | config.server_timing = true
19 |
20 | # Enable/disable caching. By default caching is disabled.
21 | # Run rails dev:cache to toggle caching.
22 | if Rails.root.join("tmp/caching-dev.txt").exist?
23 | config.action_controller.perform_caching = true
24 | config.action_controller.enable_fragment_cache_logging = true
25 |
26 | config.cache_store = :memory_store
27 | config.public_file_server.headers = {
28 | "Cache-Control" => "public, max-age=#{2.days.to_i}"
29 | }
30 | else
31 | config.action_controller.perform_caching = false
32 |
33 | config.cache_store = :null_store
34 | end
35 |
36 | # Store uploaded files on the local file system (see config/storage.yml for options).
37 | config.active_storage.service = :local
38 |
39 | # Don't care if the mailer can't send.
40 | config.action_mailer.raise_delivery_errors = false
41 |
42 | config.action_mailer.perform_caching = false
43 |
44 | # Print deprecation notices to the Rails logger.
45 | config.active_support.deprecation = :log
46 |
47 | # Raise exceptions for disallowed deprecations.
48 | config.active_support.disallowed_deprecation = :raise
49 |
50 | # Tell Active Support which deprecation messages to disallow.
51 | config.active_support.disallowed_deprecation_warnings = []
52 |
53 | # Raise an error on page load if there are pending migrations.
54 | config.active_record.migration_error = :page_load
55 |
56 | # Highlight code that triggered database queries in logs.
57 | config.active_record.verbose_query_logs = true
58 |
59 | # Highlight code that enqueued background job in logs.
60 | config.active_job.verbose_enqueue_logs = true
61 |
62 |
63 | # Raises error for missing translations.
64 | # config.i18n.raise_on_missing_translations = true
65 |
66 | # Annotate rendered view with file names.
67 | config.action_view.annotate_rendered_view_with_filenames = true
68 |
69 | # Uncomment if you wish to allow Action Cable access from any origin.
70 | # config.action_cable.disable_request_forgery_protection = true
71 |
72 | # Raise error when a before_action's only/except options reference missing actions
73 | config.action_controller.raise_on_missing_callback_actions = true
74 |
75 | # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
76 | config.generators.apply_rubocop_autocorrect_after_generate!
77 | end
78 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # Code is not reloaded between requests.
7 | config.enable_reloading = false
8 |
9 | # Eager load code on boot. This eager loads most of Rails and
10 | # your application in memory, allowing both threaded web servers
11 | # and those relying on copy on write to perform better.
12 | # Rake tasks automatically ignore this option for performance.
13 | config.eager_load = true
14 |
15 | # Full error reports are disabled and caching is turned on.
16 | config.consider_all_requests_local = false
17 | config.action_controller.perform_caching = true
18 |
19 | # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
20 | # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
21 | # config.require_master_key = true
22 |
23 | # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24 | # config.public_file_server.enabled = false
25 |
26 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
27 | # config.asset_host = "http://assets.example.com"
28 |
29 | # Specifies the header that your server uses for sending files.
30 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
31 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
32 |
33 | # Store uploaded files on the local file system (see config/storage.yml for options).
34 | config.active_storage.service = :local
35 |
36 | # Mount Action Cable outside main process or domain.
37 | # config.action_cable.mount_path = nil
38 | # config.action_cable.url = "wss://example.com/cable"
39 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
40 |
41 | # Assume all access to the app is happening through a SSL-terminating reverse proxy.
42 | # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
43 | # config.assume_ssl = true
44 |
45 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
46 | config.force_ssl = true
47 |
48 | # Log to STDOUT by default
49 | config.logger = ActiveSupport::Logger.new(STDOUT)
50 | .tap { |logger| logger.formatter = ::Logger::Formatter.new }
51 | .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
52 |
53 | # Prepend all log lines with the following tags.
54 | config.log_tags = [ :request_id ]
55 |
56 | # "info" includes generic and useful information about system operation, but avoids logging too much
57 | # information to avoid inadvertent exposure of personally identifiable information (PII). If you
58 | # want to log everything, set the level to "debug".
59 | config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
60 |
61 | # Use a different cache store in production.
62 | # config.cache_store = :mem_cache_store
63 |
64 | # Use a real queuing backend for Active Job (and separate queues per environment).
65 | # config.active_job.queue_adapter = :resque
66 | # config.active_job.queue_name_prefix = "article_template_production"
67 |
68 | config.action_mailer.perform_caching = false
69 |
70 | # Ignore bad email addresses and do not raise email delivery errors.
71 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
72 | # config.action_mailer.raise_delivery_errors = false
73 |
74 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
75 | # the I18n.default_locale when a translation cannot be found).
76 | config.i18n.fallbacks = true
77 |
78 | # Don't log any deprecations.
79 | config.active_support.report_deprecations = false
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 |
84 | # Enable DNS rebinding protection and other `Host` header attacks.
85 | # config.hosts = [
86 | # "example.com", # Allow requests from example.com
87 | # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
88 | # ]
89 | # Skip DNS rebinding protection for the default health check endpoint.
90 | # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
91 | end
92 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | # The test environment is used exclusively to run your application's
4 | # test suite. You never need to work with it otherwise. Remember that
5 | # your test database is "scratch space" for the test suite and is wiped
6 | # and recreated between test runs. Don't rely on the data there!
7 |
8 | Rails.application.configure do
9 | # Settings specified here will take precedence over those in config/application.rb.
10 |
11 | # While tests run files are not watched, reloading is not necessary.
12 | config.enable_reloading = false
13 |
14 | # Eager loading loads your entire application. When running a single test locally,
15 | # this is usually not necessary, and can slow down your test suite. However, it's
16 | # recommended that you enable it in continuous integration systems to ensure eager
17 | # loading is working properly before deploying your code.
18 | config.eager_load = ENV["CI"].present?
19 |
20 | # Configure public file server for tests with Cache-Control for performance.
21 | config.public_file_server.headers = {
22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23 | }
24 |
25 | # Show full error reports and disable caching.
26 | config.consider_all_requests_local = true
27 | config.action_controller.perform_caching = false
28 | config.cache_store = :null_store
29 |
30 | # Render exception templates for rescuable exceptions and raise for other exceptions.
31 | config.action_dispatch.show_exceptions = :rescuable
32 |
33 | # Disable request forgery protection in test environment.
34 | config.action_controller.allow_forgery_protection = false
35 |
36 | # Store uploaded files on the local file system in a temporary directory.
37 | config.active_storage.service = :test
38 |
39 | config.action_mailer.perform_caching = false
40 |
41 | # Tell Action Mailer not to deliver emails to the real world.
42 | # The :test delivery method accumulates sent emails in the
43 | # ActionMailer::Base.deliveries array.
44 | config.action_mailer.delivery_method = :test
45 |
46 | # Print deprecation notices to the stderr.
47 | config.active_support.deprecation = :stderr
48 |
49 | # Raise exceptions for disallowed deprecations.
50 | config.active_support.disallowed_deprecation = :raise
51 |
52 | # Tell Active Support which deprecation messages to disallow.
53 | config.active_support.disallowed_deprecation_warnings = []
54 |
55 | # Raises error for missing translations.
56 | # config.i18n.raise_on_missing_translations = true
57 |
58 | # Annotate rendered view with file names.
59 | # config.action_view.annotate_rendered_view_with_filenames = true
60 |
61 | # Raise error when a before_action's only/except options reference missing actions
62 | config.action_controller.raise_on_missing_callback_actions = true
63 | end
64 |
--------------------------------------------------------------------------------
/config/importmap.rb:
--------------------------------------------------------------------------------
1 | # Pin npm packages by running ./bin/importmap
2 |
3 | pin "application"
4 | pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
5 | pin "@hotwired/stimulus", to: "stimulus.min.js"
6 | pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
7 | pin_all_from "app/javascript/controllers", under: "controllers"
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | # See the Securing Rails Applications Guide for more information:
5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src style-src)
22 | #
23 | # # Report violations without enforcing the policy.
24 | # # config.content_security_policy_report_only = true
25 | # end
26 |
--------------------------------------------------------------------------------
/config/initializers/enable_yjit.rb:
--------------------------------------------------------------------------------
1 | # Automatically enable YJIT as of Ruby 3.3, as it brings very
2 | # sizeable performance improvements.
3 |
4 | # If you are deploying to a memory constrained environment
5 | # you may want to delete this file, but otherwise it's free
6 | # performance.
7 | if defined? RubyVM::YJIT.enable
8 | Rails.application.config.after_initialize do
9 | RubyVM::YJIT.enable
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4 | # Use this to limit dissemination of sensitive information.
5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/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/kaminari_config.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Kaminari.configure do |config|
4 | config.default_per_page = 25
5 | config.max_per_page = nil
6 | config.window = 2
7 | config.outer_window = 0
8 | config.left = 0
9 | config.right = 0
10 | config.page_method_name = :page
11 | config.param_name = :page
12 | config.max_pages = nil
13 | config.params_on_first_page = false
14 | end
15 |
--------------------------------------------------------------------------------
/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide HTTP permissions policy. For further
4 | # information see: https://developers.google.com/web/updates/2018/06/feature-policy
5 |
6 | # Rails.application.config.permissions_policy do |policy|
7 | # policy.camera :none
8 | # policy.gyroscope :none
9 | # policy.microphone :none
10 | # policy.usb :none
11 | # policy.fullscreen :self
12 | # policy.payment :self, "https://secure.example.com"
13 | # end
14 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization and
2 | # are automatically loaded by Rails. If you want to use locales other than
3 | # 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 | # To learn more about the API, please read the Rails Internationalization guide
20 | # at https://guides.rubyonrails.org/i18n.html.
21 | #
22 | # Be aware that YAML interprets the following case-insensitive strings as
23 | # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24 | # must be quoted to be interpreted as strings. For example:
25 | #
26 | # en:
27 | # "yes": yup
28 | # enabled: "ON"
29 |
30 | en:
31 | hello: "Hello world"
32 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # This configuration file will be evaluated by Puma. The top-level methods that
2 | # are invoked here are part of Puma's configuration DSL. For more information
3 | # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4 |
5 | rails_env = ENV.fetch("RAILS_ENV", "development")
6 |
7 | # Puma starts a configurable number of processes (workers) and each process
8 | # serves each request in a thread from an internal thread pool.
9 | #
10 | # The ideal number of threads per worker depends both on how much time the
11 | # application spends waiting for IO operations and on how much you wish to
12 | # to prioritize throughput over latency.
13 | #
14 | # As a rule of thumb, increasing the number of threads will increase how much
15 | # traffic a given process can handle (throughput), but due to CRuby's
16 | # Global VM Lock (GVL) it has diminishing returns and will degrade the
17 | # response time (latency) of the application.
18 | #
19 | # The default is set to 3 threads as it's deemed a decent compromise between
20 | # throughput and latency for the average Rails application.
21 | #
22 | # Any libraries that use a connection pool or another resource pool should
23 | # be configured to provide at least as many connections as the number of
24 | # threads. This includes Active Record's `pool` parameter in `database.yml`.
25 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 3 }
26 | threads threads_count, threads_count
27 |
28 | if rails_env == "production"
29 | # If you are running more than 1 thread per process, the workers count
30 | # should be equal to the number of processors (CPU cores) in production.
31 | #
32 | # It defaults to 1 because it's impossible to reliably detect how many
33 | # CPU cores are available. Make sure to set the `WEB_CONCURRENCY` environment
34 | # variable to match the number of processors.
35 | processors_count = Integer(ENV.fetch("WEB_CONCURRENCY") { 1 })
36 | if processors_count > 1
37 | workers processors_count
38 | else
39 | preload_app!
40 | end
41 | end
42 |
43 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
44 | port ENV.fetch("PORT") { 3000 }
45 |
46 | # Specifies the `environment` that Puma will run in.
47 | environment rails_env
48 |
49 | # Allow puma to be restarted by `bin/rails restart` command.
50 | plugin :tmp_restart
51 |
52 | pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
53 |
54 | if rails_env == "development"
55 | # Specifies a very generous `worker_timeout` so that the worker
56 | # isn't killed by Puma when suspended by a debugger.
57 | worker_timeout 3600
58 | end
59 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | resources :invoices
3 | get "/posts/tags/new" => "posts/tags#new", :as => :posts_tags
4 |
5 | resources :posts do
6 | member do
7 | resources "posts/tags", only: [:create, :destroy], as: :post_tags
8 | end
9 | end
10 |
11 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
12 |
13 | # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
14 | # Can be used by load balancers and uptime monitors to verify that the app is live.
15 | get "up" => "rails/health#show", :as => :rails_health_check
16 |
17 | # Render dynamic PWA files from app/views/pwa/*
18 | get "service-worker" => "rails/pwa#service_worker", :as => :pwa_service_worker
19 | get "manifest" => "rails/pwa#manifest", :as => :pwa_manifest
20 |
21 | # Defines the root path route ("/")
22 | root "application#welcome"
23 | end
24 |
--------------------------------------------------------------------------------
/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 bin/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-<%= Rails.env %>
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-<%= Rails.env %>
23 |
24 | # Use bin/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-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/config/tailwind.config.js:
--------------------------------------------------------------------------------
1 | const defaultTheme = require("tailwindcss/defaultTheme");
2 |
3 | module.exports = {
4 | content: [
5 | "./public/*.html",
6 | "./app/helpers/**/*.rb",
7 | "./app/javascript/**/*.js",
8 | "./app/views/**/*.{erb,haml,html,slim}",
9 | ],
10 | theme: {
11 | extend: {
12 | fontFamily: {
13 | sans: ["Inter var", ...defaultTheme.fontFamily.sans],
14 | },
15 | keyframes: {
16 | "fade-in": {
17 | "0%": { opacity: "0" },
18 | "100%": { opacity: "1" },
19 | },
20 | "fade-out": {
21 | "0%": { opacity: "1" },
22 | "100%": { opacity: "0" },
23 | },
24 | },
25 | animation: {
26 | "fade-in": "fade-in 0.5s ease-out",
27 | "fade-out": "fade-out 0.3s ease-out",
28 | },
29 | },
30 | },
31 | plugins: [
32 | require("@tailwindcss/forms"),
33 | require("@tailwindcss/aspect-ratio"),
34 | require("@tailwindcss/typography"),
35 | require("@tailwindcss/container-queries"),
36 | ],
37 | };
38 |
--------------------------------------------------------------------------------
/db/migrate/20240204163053_create_invoices.rb:
--------------------------------------------------------------------------------
1 | class CreateInvoices < ActiveRecord::Migration[7.2]
2 | def change
3 | create_table :invoices do |t|
4 | t.string :status
5 | t.integer :amount
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/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 `bin/rails
6 | # db:schema:load`. When creating a new database, `bin/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[7.2].define(version: 2024_02_04_163053) do
14 | create_table "invoices", force: :cascade do |t|
15 | t.string "status"
16 | t.integer "amount"
17 | t.datetime "created_at", null: false
18 | t.datetime "updated_at", null: false
19 | end
20 |
21 | end
22 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should ensure the existence of records required to run the application in every environment (production,
2 | # development, test). The code here should be idempotent so that it can be executed at any point in every environment.
3 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4 | #
5 | # Example:
6 | #
7 | # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8 | # MovieGenre.find_or_create_by!(name: genre_name)
9 | # end
10 |
11 | statuses = ["Completed", "Cancelled", "Refunded"]
12 |
13 | 100.times do |i|
14 | Invoice.create!(
15 | amount: rand(100.0..1000.0).round(2),
16 | status: statuses.sample,
17 | created_at: rand(1..365).days.ago
18 | )
19 | end
20 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/lib/assets/.keep
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/lib/tasks/.keep
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/log/.keep
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/426.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Your browser is not supported (426)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
Your browser is not supported.
62 |
Please upgrade your browser to continue.
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/favicon-16x16.png
--------------------------------------------------------------------------------
/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/favicon-32x32.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/storage/.keep
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/tmp/.keep
--------------------------------------------------------------------------------
/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/tmp/pids/.keep
--------------------------------------------------------------------------------
/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/tmp/storage/.keep
--------------------------------------------------------------------------------
/vendor/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/vendor/.keep
--------------------------------------------------------------------------------
/vendor/javascript/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aviflombaum/turbo-sortable-paginated-tables/4af2cb89c2ee88c8f974b91f0b93398c0e7f7be2/vendor/javascript/.keep
--------------------------------------------------------------------------------