Turn off SSL for scenarios with Selenium
Selenium on WEBrick fails on HTTPS pages because the server does not speak SSL. Disabling SSL only for those scenarios avoids Cucumber browser test failures.
Incredibly fast web apps // Speaker Deck
Performance tuning for Ruby on Rails web apps reduces slow page loads and sluggish interactions by improving frontend and backend efficiency.
ActiveRecord autosave
Child objects can be saved automatically with their parent in Rails, reducing manual persistence work and keeping associated records consistent.
RailsPanel chrome extension
Chrome panel for inspecting Rails log data, including parameters, response times, view rendering, and database requests.
Ollama: Strip image data from VCR recorded requests
VCR cassettes can bloat with base64-encoded vision payloads and leaked Basic Auth credentials; sanitizing request bodies and custom matching keep recordings small and playback reliable.
RSpec: Applying stubs only within a block
RSpec mocks normally persist for a spec; RSpec::Mocks.with_temporary_scope limits temporary stubs to a block and releases them afterward.
Rails jQuery UJS: Now Interactive
We can now plug into every facet of the Rails jQuery UJS adapter, binding to custom events, and even customizing internal functions, without hacking or monkey-patching the rails.js file itself.
Rails 3 Remote Links and Forms: A Definitive Guide
Thanks to habits engrained by Rails 2’s link_to_remote and remote_form_for, we expect that Rails 3 would also handle the AJAX response for our remote links and forms. But it doesn’t; it leaves that for you.
The dangers of url_for in Rails applications
In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used.<br />
<br />
Most often we use foo_path, which when used in Rails URL helpers will generate a relative path, where foo_url generates a full URL. In most cases the path makes most sense, but not always.
Rethinking Rails 3 Controllers and Routes | Free PeepCode Blog
The Rails router has been written and rewritten at least four times2, including a recent rewrite for the upcoming Rails 3. The syntax is now more concise.<br />
<br />
But never mind making it shorter! It’s time for a final rewrite: Let’s get rid of it altogether!
BlogFish: Ruby on Rails Security
Recently I've been made aware of people inside US Government organizations using my Ruby on Rails Security presentation as an excuse to limit Ruby on Rails adoption and projects inside those organizations.
Verifying doubles in RSpec 3
Safer test doubles in RSpec 3 verify stubbed methods and argument counts, catching interface mismatches while keeping isolated specs fast.
Tod: A Gem for handling daytime without a date
Tod handles time-of-day values without dates, avoiding timezone-related bugs when parsing, comparing, formatting, or storing hours, minutes, and seconds.
Jasmine: Fixing common errors during initialization
Jasmine boot failures can stem from browser/module detection issues, causing jasmineRequire or getJasmineRequireObj() errors in Webpacker and esbuild setups.
PSA: Be super careful with complex `eager_load` or `includes` queries
eager_load and includes can explode 1-n association queries into huge cross products, wasting memory. preload uses separate queries and avoids the row multiplication.
Rails for Zombies
Learning Rails for the first time should be fun, and Rails for Zombies allows you to get your feet wet without having to worry about configuration. You'll watch five videos, each followed by exercises where you'll be programming Rails in your browser.
current_transaction.after_commit is handy
Avoid sending side effects before database writes are durable; current_transaction.after_commit and after_rollback run work only after commit or rollback, even inside nested transactions.
Resolve Aspell errors with your Rails application
If you get an error message like that you are missing the Aspell files a specific language:
No word lists can be found for the language "de"
Solve it by installing the proper package, e.g. on Ubuntu:
sudo apt-get install aspell-de
Create an application with an older Rails version
sudo gem install rails --version="=1.2.3"
rails _1.2.3_ new-project-folder
Ruby: How to determine the absolute path relative to a file
Use File.expand_path with __dir__ or __FILE__ to build file paths that stay correct regardless of the caller’s working directory.
What's new in edge Rails: Active Record enums
Integer-backed model attributes can be queried by symbolic names, making state handling clearer and avoiding hard-coded numeric values.
Obfuscating data in Rails applications for screenshots and demonstrations
Real data makes demos and screenshots look convincing, but names and values need masking to avoid exposing sensitive information. Faker can quickly replace personal details with plausible placeholders.
How to list updateable dependencies with Bundler and Yarn
List outdated gems and packages that can be upgraded, with filters for allowed versions and dependency groups to narrow bulk updates.
Unpoly 3.15.0 released
Unpoly 3.15 improves docs, agent support, custom form fields and form behavior, with clearer errors, fewer bugs and tighter browser-like handling.