This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>App</title> | |
<%= csrf_meta_tags %> | |
<%= stylesheet_pack_tag "application", media: "all", "data-turbolinks-track": "reload" %> | |
<%= javascript_pack_tag "application", "data-turbolinks-track": "reload" %> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { environment } = require('@rails/webpacker') | |
const webpack = require('webpack') | |
environment.plugins.prepend( | |
'Provide', | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
jquery: 'jquery' | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define an application-wide content security policy | |
# For further information see the following documentation | |
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy | |
Rails.application.config.content_security_policy do |p| | |
p.default_src :self, :https | |
p.font_src :self, :https, :data | |
p.img_src :self, :https, :data | |
p.object_src :none | |
p.script_src :self, :https |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins: | |
postcss-import: {} | |
postcss-cssnext: {} | |
tailwindcss: "./app/javascript/src/tailwind.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tailwind preflight; | |
@tailwind utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Rails from "rails-ujs" | |
Rails.start() | |
import * as ActiveStorage from "activestorage" | |
ActiveStorage.start() | |
import Turbolinks from "turbolinks" | |
Turbolinks.start() | |
import { Application } from "stimulus" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey Joey, | |
I’ve been looking into this a while and I’ve run into some blockers so it’s only half of a solution for now. | |
Here’s what you can do: | |
You need the IP that every container will see your computer as (what’s traditional 127.0.0.1). See IP of HOST available within site container? for instructions on how to get that. It’s as simple as running one command in Terminal. | |
Open Local and right-click on the site you want to connect to your Rails app | |
Click “Open Site SSH” | |
Enter nano /etc/hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ | |
/* Document | |
========================================================================== */ | |
/** | |
* 1. Correct the line height in all browsers. | |
* 2. Prevent adjustments of font size after orientation changes in | |
* IE on Windows Phone and in iOS. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Rails from "rails-ujs" | |
import Turbolinks from "rails-ujs" | |
import * as ActiveStorage from "activestorage" | |
Turbolinks.start() | |
ActiveStorage.start() | |
import '../src/application.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Notifier | |
attr_reader :events | |
def initialize | |
@events = {} | |
end | |
def subscribe(event, &handler) | |
@events[event] ||= [] | |
@events[event] << handler |