ruby on rails - Comments and Rating section no longer showing up; -
i working on creating test shoe store website 1 of classes. had added comment section , rating system new shoes. reason comment , rating section no longer viewable.
here product show page
<p id="notice"><%= notice %></p> <div class="show-buttons" id="show1"> <%= link_to 'edit', edit_product_path(@product), class: "btn btn- success btn-xs" %> | <%= link_to 'back', products_path, class: "btn btn-primary btn-xs" %> </div> <div class="pay button"> <%= form_tag "/payments/create" %> <%= render partial: "shared/stripe_checkout_button" %> <%= hidden_field_tag(:product_id, @product.id) %> </div> <p> <strong>name:</strong> <%= @product.name %> </p> <p> <strong>description:</strong> <%= @product.description %> </p> <p> <strong>image url:</strong> <%= @product.image_url %> </p> <p>average rating: <div class="rated" data-score="<%= @product.average_rating %>"></div> </p> <%= render 'new_comment' %> <%= render 'comment' %> <%= will_paginate @comments %> </div> <% end %> here _comment.html.erb
<div class="container"> <div class="row"> <div class="product-reviews"> <% @comments.each |comment| %> <div class="row"> <hr> <p><%= comment.user.first_name %> <small><em><%= "# {time_ago_in_words(comment.created_at)} ago" %></em></small></p> <% if signed_in? && current_user.admin? %> <%= link_to ('<span class="glyphicon glyphicon-remove"> </span>').html_safe, product_comment_path(@product, comment), method: :delete, data: { confirm: 'are sure?' } %> <% end %> <div class="rated" data-score="<%= comment.rating %>"></div> <p><%= "rating: #{comment.rating}/5" %></p> <p><%= comment.body %></p> </div> <% end %> </div> </div> my _new_comment.html.erb
<% if signed_in? %> <h4>add review:</h4> <%= form_for([@product, @product.comments.build]) |f| %> <p> <%= f.label :body, "comments" %><br> <%= f.text_area :body %> </p> <p> <%= f.label :rating %><br> <div class= "rating"></div> </p> <%= f.submit "submit", class: "btn btn-default" %> </p> <% end %> <% end %> and product.html.erb
<div class="container"> <div class="row"> <div class="col-md-4"> <div class="productbox"> <div class="imgthumb img-responsive"> <%= image_tag(product.image_url, :class => 'list_image') %> </div> <div class="caption"> <h3><%= product.name %></h3> </div> </div><!--end productbox--> </div><!--end columns--> <div class="col-md-8" id="descriptionp"> <p><%= product.description %><br><br> <%= product.color %><br><br> €<%= product.price %><br><br> <%= link_to 'more info', product %><br><br> <% if signed_in? && current_user.admin? %> <%= link_to 'edit', edit_product_path(product) %> | <%= link_to 'destroy', product, method: :delete, data: { confirm: 'are sure?' } %> <% end %> </p> </div> </div><!--/row--> </div><!--/container --> <hr> any assistance on why can no longer view comments or rating page appreciated.
Comments
Post a Comment