[Ruby] NameError in Incomes#index error

less than 1 minute read

After creating a household account book application

NameError in Incomes#index

Got an error


<% @page_title = "List of income subjects" %>
<h2><%= page_title %></h2>

<% if @incomes.present? %>
            <th>Subject name</th>
        <% @incomes.each do |income| %>
                <td><%=income.name %></td>
                <td><%=income.description %></td>
        <% end %>

<% else %>
    <p>There are no registered subjects</p>
<% end %>

If you look closely,…

Before page on the second line


Isn’t it missing?


<h2><%= @page_title %></h2>

This is the error resolution. I’m having trouble with typos and a few omissions, so programming is a problem.

Especially for me as a beginner.

I will continue to do my best while fighting errors