Reputation: 13558
This code here:
<%= case event.subject.value
when 1
puts " upvoted"
when -1
puts " downvoted"
when 0
puts " removed a vote from"
end %>
does not result in any string being rendered. I tried adding an else
statement just in case event.subject.value
had a different value from 1, -1, or 0, but the code still evaluated to nothing. The code throws no errors...
Upvotes: 0
Views: 86
Reputation: 13558
Ok I realized what the problem was. I had to remove the puts
from the switch statement.
Upvotes: 0
Reputation: 168209
puts returns nil
. It's side effect is that it outputs to the stdout.
Upvotes: 2
Reputation: 5880
"puts" method outputs to your console( server log ), did you try to remove puts?
Upvotes: 1
Reputation: 7288
<%= case event.subject.value
when 1
" upvoted"
when -1
" downvoted"
when 0
" removed a vote from"
end %>
remove puts statement
Upvotes: 3