url_for with added params

Posted Almost 13 years ago by Henning Koch.

You cannot say this because url_for only takes one parameter: url_for(@deal, :tab => 'general') # won't work

Shell script to generate a Git commit with Pivotal Tracker story ID and title

Posted Almost 13 years ago by Tobias Kraze.

We usually generate our commit messages from Pivotal Tracker IDs and titles, like [#15775609] Index view for conflicts

Configuring ActionMailer host and protocol for URL generation

Posted Almost 13 years ago by Henning Koch.

When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...

Getting non-Aero toolbars for Thunderbird 5 on Windows 7

Posted Almost 13 years ago by Arne Hartherz.

Thunderbird 5 brings a custom chrome on Windows Vista/7 that uses translucent Aero decorations on toolbars and menubars. Here is...

Run Selenium tests in Chrome instead of Firefox

Posted Almost 13 years ago by Henning Koch.

Here is how to switch your Selenium to Chrome: Make sure you've got a recent version of chromedriver in...

How to fix: undefined method `specifications' (caused by RubyGems 1.8)

Posted Almost 13 years ago by Arne Hartherz.

Sometimes, when running a rake task, RubyGems 1.8.5 raises an error: rake aborted! undefined method `specifications' for "/usr/lib/ruby/gems/1.8":String

markbates/coffeebeans

Posted Almost 13 years ago by Lexy.
github.com

When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding...

How to use Git on Windows with PuTTY

Posted Almost 13 years ago by Arne Hartherz.
richfrog.curzons.net

Get "PuTTY Link" and "Pageant" (an SSH key agent) from the PuTTY download page. Run pageant.exe, find its icon inside...

Order in which RSpec processes .rb files

Posted Almost 13 years ago by Henning Koch.

Because your examples should not change global state, you should not need to care about the order in which RSpec...

SSL: Build a Certificate signing request (CSR)

Posted Almost 13 years ago by Thomas Eisenbarth.

In order to request a SSL certificate from any dealer, you usually need a CSR certificate. As both the CSR...

Soft-scroll to an anchor with jQuery

Posted Almost 13 years ago by Arne Hartherz.

This snippet makes links that refer to an anchor (like "...

...") scroll softly to it.\ In this example we only do...

Execution of shell code in Ruby scripts

Posted Almost 13 years ago by Dominik Schöler.
blog.jayfields.com

Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...

Sudo a gem executable does not work on Ubuntu

Posted Almost 13 years ago by Dominik Schöler.

Today I needed to execute a ruby gem executable with sudo. But, surprisingly, bash would tell me command not found...

How to define helper methods in magic DSL code

Posted Almost 13 years ago by Lexy.
gem-session.com

We use the lambda-technique to DRY up our Rails routes machinist blueprints, and, of course, RSpec examples.

Putting static content on Cloudfront

Posted About 13 years ago by Tobias Kraze.

We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...

Capistrano 2: Which Capistrano hooks to use for events to happen on both "cap deploy" and "cap deploy:migrations"

Posted About 13 years ago by Arne Hartherz.

When deploying an application with "cap deploy" by default [1] you only deploy your code but do not run migrations...

Why a Rails flash message is shown twice

Posted About 13 years ago by Dominik Schöler.
travisonrails.com

You set a flash message and it shows up as it should. However, it is displayed again the next time...

How to send HTTP requests using cURL

Posted About 13 years ago by Arne Hartherz.
linux.die.net

Reading a URL via GET: curl http://example.com/ Defining any HTTP method (like POST or PUT): curl http://example.com/users/1...

How to perform HTTP basic authentication in RSpec

Posted About 13 years ago by Arne Hartherz.

The Basic Authentication header encodes username and password. Effectively, it's just Base64 plus a "Basic" prefix.

Installing RMagick on Ubuntu

Posted About 13 years ago by Arne Hartherz.

When installing RMagick you may get an error messages like this: Version 2.13.1: checking for Ruby version >= 1.8.5... yes

Opera 11: Show full address, including GET parameters

Posted About 13 years ago by Arne Hartherz.

By default, Opera 11 hides any passed params and the URL's protocol until you focus the address bar.

wycats/artifice

Posted About 13 years ago by Lexy.
github.com

Artifice allows you to replace the Net::HTTP subsystem of Ruby with an equivalent that routes all requests to a...

Cancelling event propagation

Posted About 13 years ago by Tobias Kraze.

Within an event handler, there are multiple methods to cancel event propagation, each with different semantics. event.preventDefault() Only prevents the...

Caching in Rails

Posted About 13 years ago by Ulrich Berkmueller.

The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...