Make half-pipe compatible with rails-api

The rails-api gem creates projects that don't have any views.  Calling insert_into_file without checking first leads to a crash.