Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

twler's Profile

GitHub User: twler

Comments by

Avatar

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

Avatar

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."

Avatar

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

ruby
  around_filter :use_time_zone

  private

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

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'
end

before the catchall in routes.rb

Avatar

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.