mike927
mike927

Reputation: 774

Rails - jQuery - bootstrap-star-rating

I dont know jQuery but I would like to use 'bootstrap-star-rating' in rails form. I dont have a clue how to fetch value from input

<input id="input-1" class="rating " data-size="xs" data-min="0" data-max="5" data-step="1">

and pass it to form to be able to send value (for example "4") as parameter.

Upvotes: 1

Views: 812

Answers (1)

mike927
mike927

Reputation: 774

I've resolved my problem. Below I put the valid solution:

<%= form_for @rating do |rating_form| %>
    <%= rating_form.number_field :rating, class: 'rating', 'data-size' => 'xs'%>
    <%= rating_form.submit 'Add', class: 'btn btn-primary btn-success' %>
<% end %>

Upvotes: 0

Related Questions