Could somebody help to fix the code ,beginner

<%= @topic_view.topic.title %>
<%= @topic_view.topic.average_rating %> <%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %>

Just want to figure out my mistakes

if you post your code instead of a screenshot it is much easier to help you, and this is valid for all the topics you are creating
you may find out that more people help you if you at least do that

I do agree with ieahleen (it took me a lot of time to zoom the picture. I had to open it in a different tab to be able to do that. Before that I tried to download, but it’s impossible).

Anyway, the problem with your code is that you are not closing the brackets well in all the function calls.
E.g. you have 2 opening ones and 1 closing one.

Thank you very much!OK,I appreciate that and fix it next time!

You can use an online sandbox like Codidate to show your code, like this:

This allows you to edit and run your code. Plus, it has code intelligence which allows you to uncover syntax issues.

1 Like