import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["container"]
connect() {
<div id="projects">
<% projects.each do |project| %>
<% cache project do %>
<%= render project %>
<% end %>
<% end %>
class SubscriptionsController < ApplicationController
def new
@subscription = current_account.subscriptions.new
end
def create
<%= turbo_frame_tag 'audit_log', data: { controller: 'lazy-frame', lazy_frame_src_value: audit_log_project_path(@project) } do %>
<div class="py-6 text-gray-500">Scroll to load audit log…</div>
<% end %>
<turbo-stream action="set_title">
<template><%= "Inbox (#{@unread_count})" %></template>
</turbo-stream>
module CollectionCacheKey
extend ActiveSupport::Concern
def cache_key_for(scope)
relation = scope.respond_to?(:all) ? scope.all : scope
model = relation.klass
<div id="articles">
<%= render @articles %>
</div>
<% if @next_page.present? %>
<%= turbo_frame_tag 'next_page', src: articles_path(page: @next_page), loading: :lazy do %>
class ApplicationController < ActionController::Base
layout -> { turbo_frame_request? ? false : 'application' }
end
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["input", "results"]
static outlets = ["results-list"]
static values = {
<div id="save_state" class="text-xs text-gray-500">Not saved yet</div>
<div id="image_preview">
<%= render 'images/preview', record: @profile %>
</div>
<%= turbo_refreshes_with method: :morph, scroll: :preserve %>
<div class="posts-index">
<div class="sticky top-0 bg-white border-b" id="search-bar">
<%= form_with url: posts_path, method: :get, data: { turbo_frame: "_top", turbo_action: "morph" } do |f| %>
<%= f.search_field :q,