Reputation: 20222
I have the following code in my show
view.
<p>
<strong>Average difference:</strong>
<%= @prediction.average_difference %>
</p>
However, the field's value is not printed. What am I doing wrong?
Upvotes: 0
Views: 36
Reputation: 601
Fire up rails console to check @prediction.average_difference if it shows up a value their in console it must show the same in the view as well.
Upvotes: 1
Reputation: 4513
Probably @average_difference
attribute of @prediction
is nil
. In order to confirm that, you may write
<%= @prediction.average_difference || 'test_average_difference' %>
which should display test_average_difference
.
Upvotes: 1