When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache...
If your controller spec never reaches your controller code: Make sure you are signed in. Make sure you are actually...
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara...
This collection of Sass mixins enables cross-browser styling (including IE with CSS3PIE) with less lines of code.
For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're...
The following initializer provides an :alias => "my_route_name" option to restful routes in your route.rb. This simply makes the...
This note describes how to setup a box running Ubuntu to share its Internet connection with another PC.
If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...
This returns the name (including path) of your current layout: response.layout => "layouts/admin" # inside views that are using the 'admin' layout...
When using form_for you can give the form's target URL either as a string or an array:
If you want to see how long your database queries actually take, you need to disable MySQL's query cache...
This post will describe how I stumbled upon a code path in the Linux kernel which allows external programs to...
A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...
Both these approaches will keep your GET parameters -- and will only work for GET requests. Capybara: When /^I reload the...
It’s pretty common for projects hosted on GitHub to receive “pull requests”: requests from people who have cloned your...
When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...
This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...
Be careful! The following solution will delete files on a volume. If you don't know exactly what you're...
Physical servers worked, EC2 did not.
In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...
If you want to exclude your staging site from Google using robots.txt without running the risk to forget deleting the...
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
To return non-HTML responses (like XLS spreadsheets), we usually use the respond_to do |format| format.xls do # send spreadsheet...