Adding 'Post Likes' Functionality - mmar8/Acebook-Team_404 GitHub Wiki

Adding Post Likes Functionality

  1. Type generate migration CreatePostLikesTable into the command line this creates the db/migrate ruby file

  2. In the migrate file is a class called CreatePostLikesTable with a blank method called change in it. We added the following lines to the change method create_join_table :posts, :users rename_table :posts_users, :postslikes

  3. Type rake db:migrate into the command line to create the table

  4. Now we need to create the controller and we do this by typing bin/rails generate controller PostsLikes