百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

letsrate

> 编程语言
开源

将评分功能添加到您的 Rails 应用程序和 ActiveRecord 模型的最佳方法。

199 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

将评分功能添加到您的 Rails 应用程序和 ActiveRecord 模型的最佳方法。

Letsrate Rating Gem

Provides the best way to add rating capabilites to your Rails application with jQuery Raty plugin.

Future Of The Letsrate Gem

This gem will be updated on very early 2015 with many features. :) You can send me a message if you want to be a part of it.

Instructions

Install

Add the letsrate gem into your Gemfile

ruby
gem 'letsrate'

Generate

rails g letsrate User

The generator takes one argument which is the name of your existing devise user model UserModelName. This is necessary to bind the user and rating datas. Also the generator copies necessary files (jquery raty plugin files, star icons and javascripts)

Example:

Suppose you will have a devise user model which name is User. The devise generator and letsrate generator should be like below

rails g devise:install
rails g devise user

rails g letsrate user # => user is the model generated by devise

This generator will create Rate and RatingCache models and link to your user model.

Prepare

I suppose you have a car model

rails g model car name:string

You should add the letsrate_rateable function with its dimensions option. You can add multiple dimensions.

ruby
class Car  /cars/1 %>

Speed : 
Engine : 
Price : 

If you need to change the star number, you should use star option like below.

erb
Speed :  10 %>
Speed :  7 %>
Speed : 

You can use the rating_for_user helper method to show the star rating for the user.

erb
Speed :  10 %>

Feedback

If you find bugs please open a ticket at https://github.com/muratguzel/letsrate/issues

Issues· 42 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言