Answer the question
In order to leave comments, you need to log in
The voting form is not rendered. What to fix?
The essence of the application:
- there are lists
- each list has many items
- you can vote for each item
List page:
lists/show.html.erb
<%= render 'list_description' %>
<ol>
<%= render @list.items.order(rating: :desc) %>
</ol>
<li>
<%= item.title %>
<%= render "votes/like" %> - Этот рендер формы голосования вызывает ошибку
</li>
<%= form_for :vote, url: list_item_votes_path(:item_id => item, :list_id => @list.id) do |f| %>
<%= f.hidden_field :vot, value:'up' %>
<%= f.submit " ",class: "vote-button bth-like" %>
<% end %>
<%= form_for :vote, url: list_item_votes_path(:item_id => item, :list_id => @list.id) do |f| %>
<%= f.hidden_field :vot, value:'down' %>
<%= f.submit " ",class: "vote-button bth-dislike" %>
<% end %>
Answer the question
In order to leave comments, you need to log in
Try like this.
Local variables are usually not carried over between templates.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question