You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Iam so exhausted about it... I tried so much. Pls help me.
its my _form.html.erb
I wanna make this system.
If user select "star-rating", it is automatley filled by rating score (like 3.5)
then user write title and desc. If user click "submit" button, then review(has title/desc/star-rating) should be created.
But, I don't know how can I grab currentRating and put it in :rating params...
(when I've been tested it, I can save ca_review but there is no :rating value... it was always nil...)
Hi, Iam so exhausted about it... I tried so much. Pls help me.
its my _form.html.erb
I wanna make this system.
If user select "star-rating", it is automatley filled by rating score (like 3.5)
then user write title and desc. If user click "submit" button, then review(has title/desc/star-rating) should be created.
But, I don't know how can I grab currentRating and put it in :rating params...
(when I've been tested it, I can save ca_review but there is no :rating value... it was always nil...)
I'm using rails6.
bottom of _form.html.erb
<script> $(function() { $(".my-rating").starRating({ initialRating: 3.5, strokeColor: '#894A00', strokeWidth: 10, starSize: 35, starShape: 'rounded', onHover: function(currentIndex, currentRating, $el){ $('.live-rating').text(currentIndex); }, onLeave: function(currentIndex, currentRating, $el){ $('.live-rating').text(currentRating); const c_rating = currentRating; } }); }); </script>middle of _form.html.erb
<%= form_with(url: care_article_ca_reviews_path, class: "shadow p-3 mb-3 bg rounded", local: true) do |f| %>
<%= obj %>
ca_reviews_controller.rb
The text was updated successfully, but these errors were encountered: