Adding 'Post Likes' Functionality - mmar8/Acebook-Team_404 GitHub Wiki
Adding Post Likes Functionality
-
Type
generate migration CreatePostLikesTable
into the command line this creates the db/migrate ruby file -
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 methodcreate_join_table :posts, :users rename_table :posts_users, :postslikes
-
Type
rake db:migrate
into the command line to create the table -
Now we need to create the controller and we do this by typing
bin/rails generate controller PostsLikes