use top-level gemfile for rails app
share logic for loading previews
fix test for newer activemodel