We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...
For example if you use rvm and get this message: ERROR: Loading command: install (LoadError) no such file to load...
TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...
Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...
See attached link for a way to extract the conditions of a named scope in Rails 2.3.
JavaScripts and CSS should be minified for production use. In Rails 3.1+ the asset pipeline will take care of this...
In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...
About Chrome's network stack and optimizations to load web pages faster.
Mobile browser's ignore the autoplay attribute on and elements. Stupid reasons include saving mobile bandwidth on behalf of the...
Apache HTTP server benchmarking tool (ab) is a nice tool to test performance on sites delivered by HTTP. If the...
When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only...
Over the next year, there are a number of technologies coming down the pipeline that have the potential to radically...
If you're using the Capybara webdriver, steps sometimes fail because the browser hasn't finished loading the next page...
url = 'http://www.foocorp.com/foo/bar' URI.parse(url).host # => www.foocorp.com Note that this will raise an error if the given argument is...
If you require your Rails models manually, pay attention to the path you use. Unless you have...
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...
pjax loads HTML from your server into the current page without a full reload. It's ajax with real permalinks...
A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...
Never name your shared example group *_spec.rb. Otherwise rspec will try to load your example group as a spec and...
Today, I ran into trouble on a fairly fresh installed VM, running Ubuntu. I tried to bundle install and got...
Lately, I came across a nasty error. I had a class Article that included FooTrait and BarTrait. In BarTrait, I...
LibreOffice Impress, Writer, etc. doesn't embed most fonts into the PDFs it generates. This means if you share a...
If you're suffering from a huge de.yml or similiar file, cry no more. Rails lets you freely organize your...