<div data-controller="char-counter" data-char-counter-max-value="280">
<%= form.text_area :body, rows: 6, data: { char_counter_target: 'input' }, class: 'w-full rounded border p-2' %>
<div class="mt-1 text-sm text-gray-500">
<span data-char-counter-target="output"></span> characters remaining
</div>
</div>
<nav class="mt-6 flex gap-2">
<% if @page > 1 %>
<%= link_to 'Prev', projects_path(page: @page - 1), data: { turbo_frame: '_top' }, class: 'rounded bg-gray-100 px-3 py-1' %>
<% end %>
<%= link_to 'Next', projects_path(page: @page + 1), data: { turbo_frame: '_top' }, class: 'rounded bg-gray-100 px-3 py-1' %>
<div id="<%= dom_id(post) %>">
<%= render 'posts/card', post: post %>
</div>
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["sentinel"]
static values = {
url: String
<%= turbo_frame_tag 'wizard_step' do %>
<%= render "onboarding/steps/#{@step}", onboarding: @onboarding %>
<% end %>
<%= turbo_stream.prepend 'items' do %>
<%= render @item %>
<% end %>
<turbo-stream action="reset_form" target="new_item_form"></turbo-stream>
// app/javascript/controllers/dropdown_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["menu"]
<div data-controller="clipboard" data-clipboard-text-value="<%= invite_url(@invite) %>">
<button type="button" data-action="clipboard#copy" class="rounded bg-gray-100 px-3 py-1">
Copy invite link
</button>
</div>
<%= 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?
<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() {