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

letsrate -- the stars are not displayed :( #35

Open
zhall opened this issue Jul 6, 2013 · 5 comments
Open

letsrate -- the stars are not displayed :( #35

zhall opened this issue Jul 6, 2013 · 5 comments

Comments

@zhall
Copy link

zhall commented Jul 6, 2013

I am using rails 3.2.8 gem, ruby 1.9.3 and want to add star rating to my project. I am using the letsrate gem. The stars are not displayed. I know this is something to do either with .js or the .css files. There is no .css file though for this gem. The jquery.raty.js and letsrate.js.erb files are in app/assets/javascripts directory.The star images are in app/assets/images directory.In my /show.html.erb file I wrote:

     <% content_for :javascript_includes do %>
     <%= javascript_include_tag 'jquery.raty.js','letsrate.js.'%>
     <% end %>    
    <dd>Quality : <%= rating_for @book, "quality",:star => 5 %><br/>
   Value For Money : <%= rating_for @book, "value_for_money",:star => 5  %><br/>
   Price : <%= rating_for @book, "price", :star => 5 %></dd><br/>
Im my views/layout/application.html.erb file I wrote:
<html>
<head>
    <title><%=@page_title || '*** T&T ***'%></title>
    <%= javascript_include_tag 'application'%>
   <%= yield :javascript_includes %>            
   <%= stylesheet_link_tag 'style','application', media: "all"%>
    <%= csrf_meta_tags %>
When application runs, the stars are not displayed. Do I need to write .css file? I am really, really in dire need of your help!!! Thank you.
@zhall
Copy link
Author

zhall commented Jul 20, 2013

No help is required, I figured that out :)

@gugl
Copy link

gugl commented Sep 20, 2013

can you share the solution with us?

@yozzz
Copy link

yozzz commented Oct 4, 2013

Have the same problem...

@yozzz
Copy link

yozzz commented Oct 4, 2013

In view file:
<% content_for :javascript_includes do %>
<%= javascript_include_tag 'jquery.raty.js','letsrate.js.'%>
<% end %
In application view:
<%= yield :javascript_includes %>

This is helps me

@zhall
Copy link
Author

zhall commented Jan 12, 2015

1 step: Please paste the following lines to application.js file:
//= require jquery.raty
//= require letsrate

2 step: Execute the following cmd line in your terminal:

 rake assets:precompile RAILS_ENV=production

3 step: Copy .png files from /images folder into /public/assets directory

star-half.png
star-off.png
start-on.png

4 step: execute the following cmd line in your terminal:

rails s -e production

I am using NetBeans IDE environment, Rails 4.2 and letsrate gem 1.0.9

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