Skip to content

Commit c82d6d4

Browse files
committed
feat: setup assets pipeline and styling framework
- Bootstrap integration with custom SCSS - JavaScript modules for interactive features - Action Cable channels for real-time updates - Simple Form configuration with Bootstrap styling - Importmap configuration for modern JS
1 parent d6ba76e commit c82d6d4

9 files changed

Lines changed: 52 additions & 12 deletions

File tree

app/assets/builds/application.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/stylesheets/_custom.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ body {
2727
text-overflow: ellipsis;
2828
display: -webkit-box;
2929
-webkit-line-clamp: 2;
30+
line-clamp: 2; // Standard property for compatibility
3031
-webkit-box-orient: vertical;
3132
}
3233

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
// Bootstrap and its dependencies
2-
@import "bootstrap";
3-
4-
// Custom styles
5-
@import "custom";
6-
@import "components/navbar";
7-
@import "components/forms";
8-
@import "components/cards";
9-
@import "components/tables";
1+
// Custom styles (Bootstrap loaded via CDN in layout)
2+
@use "custom";
3+
@use "components/navbar";
4+
@use "components/forms";
5+
@use "components/cards";
6+
@use "components/tables";
107

118
// Layout styles
12-
@import "layouts/dashboard";
13-
@import "layouts/authentication";
9+
@use "layouts/dashboard";
10+
@use "layouts/authentication";

app/javascript/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
22
import "@hotwired/turbo-rails"
33
import "controllers"
4+
import "channels"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
3+
4+
import { createConsumer } from "@rails/actioncable"
5+
6+
export default createConsumer()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import consumer from "channels/consumer"
2+
3+
consumer.subscriptions.create("DashboardChannel", {
4+
connected() {
5+
// Called when the subscription is ready for use on the server
6+
},
7+
8+
disconnected() {
9+
// Called when the subscription has been terminated by the server
10+
},
11+
12+
received(data) {
13+
// Called when there's incoming data on the websocket for this channel
14+
}
15+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import consumer from "channels/consumer"
2+
3+
consumer.subscriptions.create("ImportProgressChannel", {
4+
connected() {
5+
// Called when the subscription is ready for use on the server
6+
},
7+
8+
disconnected() {
9+
// Called when the subscription has been terminated by the server
10+
},
11+
12+
received(data) {
13+
// Called when there's incoming data on the websocket for this channel
14+
}
15+
});

app/javascript/channels/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Import all the channels to be used by Action Cable
2+
import "channels/import_progress_channel"
3+
import "channels/dashboard_channel"

config/importmap.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
pin "@hotwired/stimulus", to: "stimulus.min.js"
66
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
77
pin_all_from "app/javascript/controllers", under: "controllers"
8+
pin "@rails/actioncable", to: "actioncable.esm.js"
9+
pin_all_from "app/javascript/channels", under: "channels"

0 commit comments

Comments
 (0)