// app/javascript/controllers/dropdown_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["menu"]
<div class="copy-field"
data-controller="clipboard"
data-clipboard-content-value="<%= content %>"
data-clipboard-success-value="Copied!">
<input type="text"
module TurboResponder
extend ActiveSupport::Concern
private
def respond_with_turbo(resource, on_success:, partial:, notice: nil)
<%= turbo_stream_from [current_member, :notifications] %>
<div id="notification_badge">
<%= render 'notifications/badge', count: current_member.notifications.unread.count %>
</div>
class ApplicationController < ActionController::Base
helper_method :turbo_native_app?
private
def turbo_native_app?
class ApplicationController < ActionController::Base
before_action :set_turbo_cache_control
class_attribute :turbo_no_cache, default: false
def self.no_turbo_cache
<div class="settings-layout">
<nav class="settings-sidebar">
<h2>Settings</h2>
<ul>
<% settings_sections.each do |section| %>
<li class="<%= "active" if current_page?(section.path) %>">
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = { keymap: Object }
connect() {
class CommentsController < ApplicationController
before_action :set_post
def create
@comment = @post.comments.build(comment_params)
class ButtonComponent < ViewComponent::Base
VARIANTS = {
primary: "bg-blue-600 hover:bg-blue-700 text-white",
secondary: "bg-gray-200 hover:bg-gray-300 text-gray-900",
danger: "bg-red-600 hover:bg-red-700 text-white"
}.freeze
class DashboardMetrics
include ActiveModel::Model
attr_reader :account
def initialize(account)
class CommentsController < ApplicationController
before_action :set_post
def new
@comment = @post.comments.build
end