Howto respond html or json in the same controller action with Rails 2

Rails 2.3 can return either HTML or JSON from one controller action, but render_to_string inside format.json may trigger ActionView::MissingTemplate.

jpillora/xdomain · GitHub

Makes cross-domain XHR work by tunneling communication through an IFRAME on the page, enabling requests that browser same-origin rules would block.

Defining Ruby strings with % (percent) notation

Ruby percent notation offers an alternative way to write strings without escaping quotes, useful for embedded apostrophes or quotation marks.

Ruby lets you redefine backticks

Ruby can override the backtick operator with a method named `, making command execution syntax callable as ordinary object behavior.

Spreewald 1.0.0 released

spreewald now provides a binary that lists available steps and can filter them by a search term.

Use byebug on Ruby 2+

debugger is unreliable on Ruby 2; byebug provides a fast, reliable debugger for Ruby 2.0.0+ using TracePoint and Debug Inspector.

RSpec 1.x matcher for delegations

Custom RSpec matcher for verifying delegated methods in Ruby models, including prefixed delegation like author_name.

Google Material Design with AngularJS

AngularJS-native UI elements implement Google Material Design as a complement to Polymer's paper elements, giving Angular apps a consistent material-style interface.

Google Material Design as Polymer components

Reusable UI components implement Google’s Material Design for web apps, offering prebuilt Paper elements for consistent interfaces.

Sass function to set a color to an absolute hue

Sass lacks a built-in way to assign a color a fixed hue; adjust-hue only shifts hues relatively. A small helper can target an absolute hue value.

Skype 4.3 for Linux fixes group chats

Skype 4.3 on Linux fixes group chat problems with non-Linux clients and may require removing Ubuntu packages before reinstalling.

terminator keyboard shortcuts

Manage many server sessions in terminator with split panes, window focus changes, and quick title editing using keyboard shortcuts.

Rails Assets

Automatically wraps Bower packages as gems for the Rails asset pipeline, but duplicate JavaScript copies can conflict when mixed with other package sources.

SudoSlider: a jQuery slider

Flexible jQuery content slider with minimal markup assumptions, customizable controls, and responsive slide sizing for mixed media like images, video, and text.

Working around OpenSSL::SSL::SSLErrors

Ruby and curl requests can fail when a server only accepts older SSL/TLS versions; forcing a specific protocol version can restore connectivity.

whenever: Make runner commands use bundle exec

whenever runner jobs can fail in cron because bundle exec is omitted, leading to Bundler load errors. A custom job_type restores the correct Rails runner command.

Material Design - Google design guidelines

Google’s Material Design provides a unified system for building consistent, intuitive interfaces across platforms and devices.

shoulda-matcher methods not found in Rails 4.1

allow_value and other shoulda-matchers methods can disappear under Rails 4.1 with Spring, causing NoMethodError despite the gem being listed.

Telling Spring to watch certain directories/files

Spring ignores watch paths that do not exist when #watch runs, so file or directory changes may not trigger a reboot until Spring is restarted.

Device sizing and network throttling are coming to Chrome DevTools

Chrome DevTools is gaining device sizing and network throttling, reducing the need for awkward Linux workarounds when simulating slower connections.

How to test bundled applications using Aruba and Cucumber

Bundler environment variables can shadow a Rails test app when integration-testing CLI tools with Aruba and Cucumber. Clearing the Bundler env and disabling Spring keeps commands isolated.

Cucumber step to manually trigger javascript events in Selenium scenarios (using jQuery)

Selenium can miss browser events such as change during form input; a Cucumber step can fire jQuery-registered events manually with execute_script.

Tearing Down Capybara Tests of AJAX Pages

Pending AJAX requests can die when a Capybara test ends or switches scenarios, causing flaky JavaScript specs. Waiting for the page to load helps avoid the failure.

ruby-concurrency/atomic · GitHub

Atomic value updates in multi-threaded Ruby code prevent race conditions when several threads read and write shared state.