Skip to content

Commit

Permalink
Fix application.js, manifest, and procfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Jan 29, 2022
1 parent 8f2db4a commit 5f4a5f8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: rails server
worker: sidekiq
web: bin/rails server
worker: bundle exec sidekiq
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: bundle exec rails server
web: bin/rails server -p 3000
worker: bundle exec sidekiq
js: yarn build --watch
css: yarn build:css --watch
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ You'll need the following installed to run the template successfully:
#### Creating a new app

```bash
rails new myapp -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb --skip-javascript
rails new myapp -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb
```

Or if you have downloaded this repo, you can reference template.rb locally:

```bash
rails new myapp -d postgresql -m template.rb --skip-javascript
rails new myapp -d postgresql -m template.rb
```

❓Having trouble? Try adding `DISABLE_SPRING=1` before `rails new`. Spring will get confused if you create an app with the same name twice.
Expand Down Expand Up @@ -98,7 +98,7 @@ brew services start redis
##### Ubuntu
```
sudo apt-get install redis-server
```
```

#### Cleaning up

Expand Down
2 changes: 2 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//= link_tree ../builds
//= link_tree ../images
4 changes: 2 additions & 2 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ require("@rails/ujs").start()
import './channels/**/*_channel.js'
import "./controllers"

import 'bootstrap'
import * as bootstrap from "bootstrap"

document.addEventListener("turbo:load", () => {
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
Expand All @@ -25,4 +26,3 @@ document.addEventListener("turbo:load", () => {
return new bootstrap.Popover(popoverTriggerEl)
})
})
import './channels/**/*_channel.js'
9 changes: 5 additions & 4 deletions template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ def add_javascript

def copy_templates
remove_file "app/assets/stylesheets/application.css"
remove_file "app/javascript/application.js"
remove_file "app/javascript/controllers/index.js"
remove_file "Procfile.dev"

copy_file "Procfile"
copy_file "Procfile.dev"
copy_file ".foreman"
copy_file "esbuild.config.js"
copy_file "app/javascript/application.js"
copy_file "app/javascript/controllers/index.js"

directory "app", force: true
Expand Down Expand Up @@ -241,16 +243,15 @@ def add_esbuild_script
add_multiple_authentication
add_sidekiq
add_friendly_id

copy_templates
add_bootstrap
add_whenever
add_sitemap
add_bootstrap
add_announcements_css
add_esbuild_script

rails_command "active_storage:install"

copy_templates

# Commit everything to git
unless ENV["SKIP_GIT"]
git :init
Expand Down

1 comment on commit 5f4a5f8

@carsonmulligan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking through these changes to see how I can get the navbar toggle-dropdown to work--wondering where my JS dependencies might be incorrect. Will update when I get it working.

Please sign in to comment.