Loading…
3+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes erb basics, form with, partials layouts.
Suggested path
Topics follow a teaching order. Each answer ends with a clear Next question control so you can move forward without hunting the list.
Rails views and forms interview questions test whether you understand the presentation layer that delivers HTML to the browser. This module covers ERB syntax (<%= %> outputs and escapes, <% %> executes without output, <%# %> is a comment), layouts and the yield keyword for content injection, partials with render and the locals option for passing data, form_with and how it generates CSRF tokens automatically, the common view helpers (link_to, button_to, image_tag, number_to_currency, pluralize, humanize), content_for and yield with a named block for page-specific content, flash display in layouts, iterating with .each in ERB templates, and why automatic HTML escaping in ERB protects against XSS. All examples are beginner-level — no decorators, no ViewComponent.
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–3 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–3 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q3.