Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rating not working on edit form #34

Closed
gswartz777 opened this issue Sep 14, 2015 · 2 comments
Closed

rating not working on edit form #34

gswartz777 opened this issue Sep 14, 2015 · 2 comments

Comments

@gswartz777
Copy link

I have a form where the user can select the number of stars for the rating. When saving the record and coming back to edit it, the form starts with 5 empty stars rather than the rating that was saved previously. If I mouse over the stars and then mouse off, the rating then appears properly. Here's the html...

<div class="form-group">
            <label for="company_rating">Rating</label>
            <div class="rating-input">
                   <i class="glyphicon glyphicon-star-empty" data-value="1"></i>
                   <i class="glyphicon glyphicon-star-empty" data-value="2"></i>
                   <i class="glyphicon glyphicon-star-empty" data-value="3"></i>
                   <i class="glyphicon glyphicon-star-empty" data-value="4"></i>
                   <i class="glyphicon glyphicon-star-empty" data-value="5"></i>
            </div>
           <input class="rating hidden" id="company_rating" name="company[rating]" type="number" value="4">
</div>

And after mousing over the stars, here's the rendered html.

<div class="form-group">
            <label for="company_rating">Rating</label>
            <div class="rating-input">
                   <i class="glyphicon glyphicon-star" data-value="1"></i>
                   <i class="glyphicon glyphicon-star" data-value="2"></i>
                   <i class="glyphicon glyphicon-star" data-value="3"></i>
                   <i class="glyphicon glyphicon-star" data-value="4"></i>
                   <i class="glyphicon glyphicon-star-empty" data-value="5"></i>
           </div>
           <input class="rating hidden" id="company_rating" name="company[rating]" type="number" value="4">
      </div>
@nathansamson
Copy link

Same problem here

@javiertoledo
Copy link
Owner

This has been solved by PR #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants