How To Create a Follow Feature in Rails by Aliasing Associations

Use macros to create association methods

Leizl Samano
Better Programming
Published in
6 min readSep 26, 2019

--

Photo by Ben Kolde on Unsplash

In order to give users the ability to follow other users in your Rails app, you’ll have to create a table for follows. The follows table will be a join table that joins the users table to itself.

--

--

Full Stack Web Developer || Software Engineering Coach at Flatiron School || Join intelligence with love to make wonderful things