There are times when you need to send SQL to the database, like this: def self.some_count(field) field = connection.quote...
Then /^I should get a response with status (\d+)$/ do |status| response.status.should include(status) end Capybara Then /^I should...
I love ETags, but there’s something that annoys me: most implementations revolve around pulling a record out of a...
Find-as-you-type boxes are usually built by observing changes in a text field, and querying the server via...
This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...
You cannot use Array#join on an array of strings where some strings are html_safe and others are not...
When you are using Apache for development, it still accepts connections from everyone in the same network as you.
If you want your application to display properly on iPad, iPhone or Android there are two things to do:
Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...
If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.
When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
If you need to find out which of your local commits are not on the remote server do this:
I was recently confronted with the task of creating a two-column liquid layout with a header and footer in...
In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache...
You configured authentication in your Apache configuration that requires username and password but you want a single IP address, host...
To clear the query cache in your MySQL database manually, e.g. for database profiling, execute the following command in your...
So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...
When you eagerly load an association list using the .include option, and at the same time have a .where on...
Sometimes, you just need to shoot from the hip…or deploy your local changes without committing them. Put this snippet...
Use the htmlentities gem. Encoding works like this: require 'htmlentities' coder = HTMLEntities.new string = "<élan>" coder.encode(string) # => "<élan>"
These two models can be used to access the posts and associated comments of a WordPress database.
If you modified git's history and the change was already pushed, you will usually get a ! [rejected] my-branch...
To change the commit message of the latest (unpushed, unmerged) commit, you can use git commit --amend