我正在运行Rails3.2,并尝试使用以下命令添加一个评级系统:http://wbotelhos.com/raty/。
出于某种原因,尽管我已经添加了:
$('#rating').raty();添加到我的脚本,然后
<div id="rating"></div>在我的网页上,我仍然看不到星星。
我已经添加了:
//= require jquery.raty到我的application.js,并将jquery.raty.js放在我的javascripts文件夹中。
我似乎不知道我做错了什么。
我尝试过使用gem:https://github.com/bmc/jquery-raty-rails,但也不起作用
发布于 2015-01-12 17:32:05
你给星星加照片了吗?确保在资源/图像中也有star-on.png和star-off.png,在html.erb文件中添加以下代码。
<script>
$(document).ready(function() {
$("#rating").raty({
path: '/assets/'
});
})
</script>发布于 2013-05-31 02:51:22
您需要包含javascript调用:
$('#star').raty();为了得到
<div id="star"></div>来展示。
https://stackoverflow.com/questions/16041115
复制相似问题