Tag handling is currently custom. Replace it with something off the shelf such as https://github.com/mbleigh/acts-as-taggable-on. See https://www.ruby-toolbox.com/categories/rails_tagging