<!DOCTYPE html>
<html>
<head>
<title><%= content_for(:title) || "App" %></title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
import { Turbo } from "@hotwired/turbo-rails"
Turbo.StreamActions.redirect = function () {
const url = this.getAttribute("url")
if (!url) return
<!DOCTYPE html>
<html>
<head>
<title><%= content_for(:title) || "App" %></title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["input", "frame"]
static values = { url: String, delay: { type: Number, default: 300 }, min: { type: Number, default: 2 } }
<div class="bookmarks">
<h1>Saved Bookmarks</h1>
<table>
<tbody id="bookmarks">
<%= render partial: "bookmark", collection: @bookmarks %>
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["wrapper", "template", "anchor"]
add(event) {
<%# locals: item %>
<button
type="button"
class="toggle-btn"
data-controller="toggle"
data-action="click->toggle#toggle"
class Task < ApplicationRecord
POSITION_GAP = 1024
belongs_to :board
scope :ordered, -> { order(:position) }
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["field"];
connect() {
from decimal import Decimal
from django.db import models
from django.db.models import F, ExpressionWrapper, DecimalField
module FlashHelper
FLASH_CLASSES = {
"notice" => "flash--success",
"alert" => "flash--error",
"error" => "flash--error"
}.freeze
<h1>New Article</h1>
<form action="/articles" method="post">
<div>
<label for="title">Title</label>
<input id="title" type="text" name="article[title]"