Force absolute URLs in views throughout a response
Relative view helpers generate path-only links and persistent asset hosts; enforcing full URLs needs separate handling for asset_host and rewrite_options.
Spreewald: Content-Disposition not set when testing a download's filename
Public file downloads may miss Content-Disposition, so filename checks fail in Spreewald. Matching only Content-Type or testing the downloaded file avoids flaky download assertions.
Bookmarklet to generate a commit message with Pivotal Tracker story ID and title
Generate commit messages from selected Pivotal Tracker stories with ID and title for traceable git history.
Disable text selection on iOS and Android devices
Mobile browsers can trigger accidental text highlighting and copy menus, confusing users. A small JavaScript/jQuery workaround suppresses selection on touch devices.
Manually uploading files via AJAX
Binary file uploads need FormData so AJAX can send multipart payloads from file inputs without manual serialization; older browsers often need a plain form fallback.
Listening to bubbling events in Prototype is easy
Prototype event handling on individual elements is brittle and breaks after AJAX replacement. Delegated document.on bindings keep change handlers working on dynamic content.
How to: Use Ace editor in a Webpack project
Ace editor adds syntax highlighting and auto-indenting for in-browser code editing, with a working brace setup for Ruby on Rails Webpacker and Webpack 2.
AngularJS directive to format a text with paragraphs and new lines
Plain text in AngularJS can be rendered as paragraphs and line breaks while escaping HTML fragments, similar to Rails simple_format.
DOM API for jQuery users
Quick reference for replacing common jQuery DOM tasks with native browser APIs and handling event delegation gaps without jQuery.
Use jQuery's selector engine on vanilla DOM nodes
Use Sizzle via $.find to select descendants from plain DOM nodes when jQuery collections are unavailable, too slow, or awkward for whole-document work.
Restangular: How to remove an element from a collection without breaking restangular
Removing an item from a Restangular collection with _.without drops custom collection attributes like route, breaking later parent-based requests. splice keeps the array object intact.
Pre-releasing a Ruby gem
Release candidate and beta gem versions are treated as pre-releases and are ignored unless explicitly requested; RubyGems converts dash-separated SemVer pre-release tags to dot-separated versions.
CSS: How to force background images to scale to the container, ignoring aspect ratio
Background images can fill a container without preserving aspect ratio by setting background-size: 100% 100%. SVG viewBox can still lock proportions.
How to click hidden submit buttons with Selenium
Hidden form submit buttons cannot be clicked directly in Selenium-based Cucumber scenarios; temporarily revealing the element and ancestor containers makes the click possible.
How to build a fully custom TinyMCE 5 dialog
TinyMCE 5 can host fully custom dialogs through a toolbar button and a separate view, with editor interaction handled via postMessage.
Coffeescript: Caveat when cloning objects with fat-arrow methods
Fat-arrow methods in CoffeeScript stay bound to the original instance after cloning, so copied objects can keep using the wrong state. Custom clone() logic with new avoids the issue.
How to create memory leaks in jQuery
Detached jQuery elements with event handlers or data can stay in memory because cache entries survive native DOM removal and old IE circular-reference limits.
Dynamically uploading files to Rails with jQuery File Upload
Immediate multi-file image uploads in Rails with progress bars, previews, and cached attachments support a single gallery form and responsive UI.
Geocoding Strategies - Google Maps API
Choosing client-side or server-side Google geocoding affects quota usage, especially in cloud hosting where shared IPs can exhaust fixed daily limits.
Check that an element is hidden via CSS with Spreewald
CSS-hidden text can pass Rack::Test because it inspects only the DOM, while Selenium checks actual visibility for user-facing content.
include_tags with the asset pipeline
Rails asset paths depend on a leading slash when using javascript_include_tag or stylesheet_link_tag; files in /assets also need to be added to the precompile list.
Reverse-proxying web applications with Apache 2.4+
Apache 2.4+ can act as a reverse proxy for apps on other hosts or paths, including redirect, cookie, and asset-path rewriting when the backend is not proxy-aware.
A few recent CSS properties
Modern CSS features improve progressive enhancement, visual effects, touch handling, and scroll behavior across browser support levels.
How to test print stylesheets with Cucumber and Capybara
Print stylesheets often regress as apps evolve, leaving paper output cluttered or unreadable. Cucumber and Capybara can verify visible content, white backgrounds, and hidden controls.