Last active
September 15, 2025 07:04
-
-
Save blahutka/2feddc5b31fb510bf3d66c5513f5b8b2 to your computer and use it in GitHub Desktop.
This is Phlex & Stimulus controllers setup + SASS. It will load Stimulus and SASS/CSS files from from app/components/* directory.
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
| // app/assets/stylesheets/application.scss | |
| @import "components/ui/button"; |
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
| # config/initializers/assets.rb | |
| Rails.application.config.assets.paths << Rails.root.join("app") |
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
| # config/environments/development.rb | |
| config.importmap.cache_sweepers << Rails.root.join('app/components') |
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
| pin_all_from "app/components", under: "components", to: "components" |
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
| // app/javascript/controllers/index.js | |
| // | |
| // Import and register all your controllers from the importmap under controllers/* | |
| import { application } from "controllers/application" | |
| import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" | |
| eagerLoadControllersFrom("controllers", application) | |
| eagerLoadControllersFrom("components", application) |
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
| // app/assets/config/manifest.js | |
| // | |
| //= link_tree ../../components .js |
Author
blahutka
commented
Mar 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment