import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["input", "counter"]
static values = {
max: { type: Number, default: 280 }
<div class="search-page">
<div class="search-header mb-6">
<h1 class="text-2xl font-bold mb-4">Search Posts</h1>
<%= form_with url: posts_path,
method: :get,
class PostsController < ApplicationController
def create
@post = current_member.posts.build(post_params)
if @post.save
redirect_to @post, status: :see_other
class Comment < ApplicationRecord
belongs_to :commentable, polymorphic: true
belongs_to :author, class_name: "User"
scope :visible, -> { where(deleted_at: nil).order(:created_at) }
<%= turbo_stream_from [Current.account, :notifications] %>
<div id="notifications"></div>
<%= link_to 'Sort: newest', projects_path(sort: 'new'),
data: { turbo_action: 'replace' },
class: 'text-sm text-gray-700 hover:underline' %>
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["source"]
async copy() {
<turbo-stream action="highlight" target="<%= dom_id(@project) %>">
<template>
<%= render @project %>
</template>
</turbo-stream>
<head>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= turbo_refreshes_with method: :morph, scroll: :preserve %>
</head>
<%= turbo_frame_tag dom_id(contact) do %>
<tr class="contact-row">
<td><%= contact.name %></td>
<td><%= contact.email %></td>
<td><%= contact.role.titleize %></td>
<td class="actions">
class ExportJob < ApplicationJob
def perform(export_id)
export = Export.find(export_id)
export.update!(status: :processing, percent: 0)
broadcast(export)
<%= turbo_stream_from [Current.account, :events] %>