Search code examples
ruby-on-rails-4raty

Want to store rate while add/create new product


I'm working on one application where I have to add rate a product while I'm adding(creating) it. Right now I have used RatyRate but it is not storing the rates while I create/add product first time.

Is there any configuration to achieve this in RatyRate implementation?

If not then please suggest If there is any other gem to achieve this.

Thanks!


Solution

  • I would suggest you to create the rating component yourself which is quite simple. One simple way would be to add a rating Model which belongs to your User and a rating column to your Product.

    However if you are looking for a gem, you can try act_as_votable and tweak it to your needs but it will be more difficult than building it yourself.