To be honest I'm not super sure what's going on here. I do know that you have to be signed in, that's what `before_filter :authenticate_user!` does.

As for the other stuff, I'm not 100% sure what's going on but I had to add those to make it work. I'll investigate further.