Search⌘ K
AI Features

Challenge Solution: Controller

Explore how to implement the comments controller in Ruby on Rails by managing comment creation linked to specific records. Understand controller actions, model associations, and response handling to effectively track and save user comments within your application.

Solution

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

Explanation

app/controllers/comments_controller.rb

Line 28: Retrieves the link_id for the currently opened link and stores it in an instance variable (@link). Each request for comment has to keep ...