Posts tagged with "Rails"

Faster Rails Development with Vagrant

Vagrant is an excellent tool for Rails development - you do not need to worry about installing dependencies, damaging your local workstation, or disparity between different machines and operating systems. You can quickly scale the size and shape of the virtual ...

Authorizers, Extractors, and Policy objects

Recently I was working on a Rails 4 project, and much to my surprise, my favorite authorization framework is not supported! CanCan had long been my "go-to" framework for its simplicty and readability. I started searching the Internet for alternative gems, but m...

A new way to cancan

Inspired by one of my student's code, I recently adopted a new way to define authorization with cancan. Often times, it can be very cumbersome to keep track of all the different resources and roles inside an application. Imagine a hypothetical application that ...

Goodbye .htaccess, Hello Rails

Remember the good old days of PHP? Mastering a redirect was nearly impossible without complicated PHP code or writing a server instruction (.htaccess). Let's take a minute to examine the past and present, and then compare and contrast some of the advantages and...

Show generated SQL in Rails 3 console

Have you ever wanted to see the resulting SQL of a query in Rails console? Well, unfortunately there's not really an 'easy' way to do this, other than hacking the console, so here we go. Fire up your Rails console. I'm using Rails 3, but this should would in <3...