class UpcaseComponent < ApplicationComponent include LiveComponent::Base def initialize(value:) @value = value end def upcase(silly: false) @value.upcase! @value << "😛" if silly end end
class UpcaseComponent < ApplicationComponent include LiveComponent::Base def initialize(value:) @value = value end def upcase(silly: false) @value.upcase! @value << "😛" if silly end end
import { live, LiveController } from "@camertron/live-component"; @live("UpcaseComponent") export class UpcaseComponent extends LiveController { // wired to a button or something via data-action attribute (not shown) on_click() { this.render((component) => { component.call("upcase"); }); } }
import { live, LiveController } from "@camertron/live-component"; @live("UpcaseComponent") export class UpcaseComponent extends LiveController { // wired to a button or something via data-action attribute (not shown) on_click() { this.render((component) => { component.call("upcase"); }); } }
import { live, LiveController } from "@camertron/live-component"; @live("UpcaseComponent") export class UpcaseComponent extends LiveController { // wired to a button or something via data-action attribute (not shown) on_click() { this.render((component) => { component.call("upcase", { silly: true }); }); } }
import { live, LiveController } from "@camertron/live-component"; @live("UpcaseComponent") export class UpcaseComponent extends LiveController { // wired to a button or something via data-action attribute (not shown) on_click() { this.render((component) => { component.call("upcase", { silly: true }); }); } }