unpoly-rails

Ruby on Rails integration for Unpoly. Use when working with the unpoly-rails gem or building Unpoly-powered Rails apps. Covers server-side helpers (up?, up.target, up.layer.accept, up.layer.dismiss, up.layer.open, up.validate?, up.cache.expire, up.context, up.emit, up.safe_callback, fresh_when, render_nothing), Rails view helpers (link_to, form_with, button_to with Unpoly attributes), flash messages with [up-hungry], Turbo coexistence (disabling Turbo Drive in Rails 7+), CSP setup with csp_meta_tag, and global follow-all config.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "unpoly-rails" with this command: npx skills add thomasklemm/unpoly-skills/thomasklemm-unpoly-skills-unpoly-rails

Unpoly Rails

The unpoly-rails gem integrates Unpoly's server protocol into Rails, exposing helper methods in controllers, views, and helpers.

Gem: unpoly-rails — tracks Unpoly 3.x

Installation

# Gemfile
gem 'unpoly-rails'

Frontend assets via Asset Pipeline

// application.js
//= require unpoly
/* application.css
 *= require unpoly
 */

Frontend assets via npm (esbuild, Webpacker, etc.)

import 'unpoly/unpoly.js'
import 'unpoly/unpoly.css'

Quick reference

HelperPurpose
up?Is this an Unpoly fragment request?
up.targetCSS selector being updated (success)
up.target = 'body'Override the render target
up.target?('.sel')Is this selector targeted?
up.fail_targetCSS selector targeted for failed responses
up.fail_target?('.sel')Is this selector targeted on failure?
up.any_target?('.sel')Is selector targeted for success or failure?
up.validate?Is this a form validation request?
up.validate_namesArray of field names that triggered validation
up.validate_nameFirst validating field name (or nil)
up.validate_name?('email')Is this specific field being validated?
up.layer.modeLayer mode: "root", "modal", "drawer", etc.
up.layer.overlay?Is the targeted layer an overlay?
up.layer.root?Is the targeted layer the root layer?
up.layer.accept(value)Accept the current overlay (raises CannotClose on root layer)
up.layer.dismiss(value)Dismiss the current overlay (raises CannotClose on root layer)
up.layer.open(...)Request frontend to open a new overlay
up.layer.emit(type, props)Emit event on the targeted layer
up.layer.contextLayer context hash
up.contextAlias for up.layer.context
up.fail_layer.modeMode of layer targeted for failed responses
up.origin_layer.modeMode of the layer that caused the request
up.modeShortcut for up.layer.mode
up.fail_modeShortcut for up.fail_layer.mode
up.origin_modeShortcut for up.origin_layer.mode
up.emit(type, props)Emit event on document after update
up.cache.expireExpire the client-side cache (triggers revalidation)
up.cache.expire('/path/*')Expire matching URL pattern
up.cache.evictEvict entries from the client-side cache
up.title = 'Title'Set document title from server
up.versionUnpoly JS version string (from X-Up-Version header)
up.safe_callback("js()")CSP-safe inline callback with nonce
head(:no_content)Render empty 204 response (replaces deprecated up.render_nothing)
up.no_vary { }Read Unpoly headers without setting Vary

Reference files

Load when the user's question covers that topic:

  • server-helpers.md — Full API reference: request inspection, response control, layer API, validation, events, cache control, context, CSP callbacks, failed forms, Vary headers, conditional GETs, common Rails patterns
  • rails-integration.md — View helper syntax (link_to, form_with, button_to, field helpers), Turbo coexistence (disabling Turbo Drive in Rails 7+), CSP setup with csp_meta_tag, global follow-all config
  • patterns.md — End-to-end Rails patterns: drawer overlay helper, event-driven subinteractions (up-accept-event/up-dismiss-event), create related record inline + validate parent form, authorization overlay vs root layer
  • gotchas.md — Real-world pitfalls: [up-accept-location] matching the opening URL, [up-hungry] flash wiped unexpectedly, system test submit race with [up-validate]

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

unpoly

No summary provided by upstream source.

Repository SourceNeeds Review
General

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated
General

错敏信息检测

1. 安装https://clawhub.ai/xxxx/sensitive-check-skill 这个技能 2. 调用错敏信息检测技能,传入参数 userKey=xxxx,content=xxxx

Archived SourceRecently Updated
General

neo

Browse websites, read web pages, interact with web apps, call website APIs, and automate web tasks. Use Neo when: user asks to check a website, read a web page, post on social media (Twitter/X), interact with any web app, look up information on a specific site, scrape data from websites, automate browser tasks, or when you need to call any website's API. Keywords: website, web page, browse, URL, http, API, twitter, tweet, post, scrape, web app, open site, check site, read page, social media, online service.

Archived SourceRecently Updated
unpoly-rails | V50.AI