January 2012
3 posts
Ensuring a Trailing Slash in Rails W/Out...
For some reason this is more difficult in rails than it should be. The semantic value of the concept of having a trailing slash in the URL is basically one of representing a folder, a virtual directory. In RESTful terms, this represents a collection route, or an :index action. Exhibit A: GET /products/ This page will list many products as links. In restful terms, this will lead to the :show...
Jan 24th
Jan 19th
8,558 notes
False Positive Tests in Rails, ProTip
False positive tests are a special kind of evil. This is the kind of stuff that will cost you your annual raise. One of the ways this has recently crept up and done me wrong is very intuitive, yet so hard to find if you look in all the wrong places: caching. Specifically: # app/controllers/your_controller.rb Rails.cache.fetch(you_key) do # testable code end At this point, make sure your...
Jan 10th