Filter and sort ActiveRecord model for Rails app with Bootstrap view helpers