Basic Challenge: Dislike Links
Add a dislike button to your application similar to the like button.
We'll cover the following
Problem statement
You currently only have a ‘like’ button displaying in our index
view. Your task is to add a similar button for ‘dislike’.
You have to do the following:
- Create a
dislike
action inlinks_controller.rb
- Configure the route for the
dislike
action - Configure the index view to display a ‘dislike’ button similar to a like button
Refer to the lesson on Acts as Votable for what methods to use for creating your dislike
action.
Note: Displaying the dislike count is optional. You can make a call to
get_downvotes.size
on a link to get the count of dislikes.
Get hands-on with 1400+ tech skills courses.