I was asked to implement result URL slug applying filters (ie. /content/best-2014-wedding-articles) to a segment already serving other content (ie. an article /content/ways-to-ruin-your-wedding). Doing this without a unique prefix or suffix differentiating a filter page from a detail page route means using Ruby on Rails routes constraints to do a...

This short post assumed you are familiar with what HTTP caching is and what rack-cache does. If not read this. I am using rack-cache 1.2 inside a Ruby on Rails 4.1 application, its default behaviour treats every URL including the query string as a separate fragment in the meta store....

{ "ruby": "2.1", "rails": "4.1", "os": "OSX 10.10" } When I am working on a Ruby on Rails application views and I see more Ruby code then markup I move that logic in to a helper. If the helper needs to output markup you should avoid using a blob of...

Given the following data set: | active | tag | | true | lego | | true | cats | | false | dogs | When working in MySQL you can order by field values using: SELECT * FROM entries WHERE active = true ORDER BY FIELD(tag, 'lego', 'cats', 'dogs');...

We’re all familiar with search engine friendly URLs ie. a filter on ‘Mid range’ would be hyphenated to /mid-range. TL;DR you can have a slug with multiple hyphenated search terms by iterating and extracting the terms in your taxonomy from the slug but you must ensure only one slug will...