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/channels/notification.js | |
import consumer from "./consumer"; | |
consumer.subscriptions.create({ channel: "NotificationChannel" }, { | |
connected() { | |
console.log("Connected to the notification channel"); | |
}, | |
disconnected() { | |
console.log("Disconnected from the notification channel"); |
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
# Rails.root /app/models/user.rb | |
class User | |
has_attached_file :photo, | |
styles: { | |
medium: { | |
processors: [:watermark], | |
geometry: "300x300>", | |
watermark_path: "#{Rails.root}/public/images/watermark.png" | |
convert_options: { "-strip -auto-orient -colorspace sRGB" } #or whatever options you want | |
}, |