Intern Track Roadmap

AI learning: documentation

This course uses an AI assistant as a tutor for asking why Rails code works, instead of as a code generator. It traces two conventions to the Rails source installed in the project. One is how root_path comes from define_method when the routes are drawn, so link_to can call it. The other is how Article maps to the articles table through undecorated_table_name. It separates asking why about code in hand from pasting unread answers. It also covers phrasing a specific why-question and checking a tutor's explanation against a console check or the gem's source.

What you'll learn

  • ✓Why link_to can call root_path, traced to define_method in the Rails source
  • ✓How Article maps to the articles table through undecorated_table_name
  • ✓The difference between asking why and copying AI code blindly
  • ✓How to phrase a specific why-question that asks for the mechanism
  • ✓Checking an AI tutor's explanation with a console check or the gem's source
Free preview · Lesson 1 2 min read

A good question to ask an AI tutor

link_to "Home", root_path and Article.find(1) both work the moment you type them, with no visible explanation of why. One student asks an AI assistant: "write me a method that finds an article by id." Another asks: "I have this Article.find(1) line, and it finds a row in a table called articles…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...