class ProductsController < ApplicationController
PER_PAGE = 24
def index
@page = [params[:page].to_i, 1].max
@sort = %w[name price recent].include?(params[:sort]) ? params[:sort] : "recent"
<%= 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 ActivityPanelController < ApplicationController
def show
@project = Project.find(params[:project_id])
@events = @project.events.order(created_at: :desc).limit(50)
latest = @events.maximum(:updated_at)
Rails.application.routes.draw do
concern :tabs do
get :profile, on: :collection
get :billing, on: :collection
get :security, on: :collection
end
<div class="layout" data-controller="viewport">
<%= turbo_frame_tag "master", class: "master-pane" do %>
<h1>Products</h1>
<ul class="product-list">
<% @products.each do |product| %>
<li>
<%= turbo_frame_tag 'modal' %>
<h1>Catalog</h1>
<%= turbo_frame_tag "products" do %>
<div class="product-grid" data-controller="frame">
<% @products.each do |product| %>
<%= render "products/card", product: product %>
class WizardsController < ApplicationController
STEPS = %w[account profile confirm].freeze
before_action :set_step
def show
<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) %>">
<%= 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' } %>
class SessionsController < ApplicationController
def new
@user = User.new
end
def create