// 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)
import { StreamActions } from "@hotwired/turbo"
StreamActions.flash = function () {
const container = document.getElementById("flashes")
if (!container) return
class CommentsController < ApplicationController
before_action :set_post
def new
@comment = @post.comments.build
end
<%= link_to 'Newest', posts_path(sort: 'new'), data: { turbo_frame: 'results', turbo_action: 'replace' } %>
<%= link_to 'Popular', posts_path(sort: 'popular'), data: { turbo_frame: 'results', turbo_action: 'replace' } %>