Search⌘ K
AI Features

Challenge Solution: Dislike Links

Understand how to implement dislike actions in a Rails application by using acts_as_votable methods, configuring routes, and updating views. This lesson guides you through modifying your controller, routes, and views to enable users to register dislikes similarly to likes.

Solution

//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

Explanation

app/controllers/links_controller.rb

Line 52-60: The dislike action is almost identical to the like action. The only difference is in the acts_as_votable methods that we ...