RailsCasts Pro episodes are now free!

Learn more or hide this

Tyler Warnock's Profile

GitHub User: twler

Comments by Tyler Warnock


Was easy to debug, but still cost me 10 minutes...


He talks about this in the video: " If we used a before_filter here instead the time zone would leak through to other requests so it’s necessary to use an around filter instead."


FWIW, I implemented a simple around_filter as shown here in my ApplicationController and it has massively slowed down my requests:

  around_filter :use_time_zone


  def use_time_zone(&block)
    Time.use_zone('Eastern Time (US & Canada)', &block)

Jasmine can have problems if you have a catchall route at the end of your routes.rb file. To solve, you can add

if Rails.env.development?
  mount Jasminerice::Engine => '/jasmine'

before the catchall in routes.rb


Does anyone know how to grab just the first frame of an animated gif and save it as a png? I'm having trouble finding this on stackoverflow and blogs.

The goal is to allow the user to upload gifs, but to only use the first frame so that there's not motion all over the page.