Flash.keep in before_filter rendering a blank page

Im trying to do

def keep_book_photos
flash.keep(:book_photos)
end

as a before_filter for my controller, however, the
“flash.keep(:book_photos)” makes the browser render nothing, just a
blank screen. I tried before_filter and prepend_before_filter.

I know I can just put it in every method call but I wish there was an
easier way.