Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

Commit

Permalink
indexed asset
Browse files Browse the repository at this point in the history
  • Loading branch information
petertoth committed Jul 21, 2013
1 parent 6ec6008 commit d2da2a8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
13 changes: 0 additions & 13 deletions app/assets/stylesheets/seems_rateable/application.css

This file was deleted.

2 changes: 1 addition & 1 deletion lib/seems_rateable/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def rating_for(obj, opts={})
end

def seems_rateable_stylesheet
stylesheet_link_tag "seems_rateable/jRating.jquery"
stylesheet_link_tag "seems_rateable"
end

private
Expand Down
27 changes: 27 additions & 0 deletions lib/seems_rateable/helpers.rb~
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module SeemsRateable
module Helpers
def rating_for(obj, opts={})
raise Errors::InvalidRateableObjectError unless obj.class.respond_to?(:rateable?)

options = {
:dimension => nil,
:static => false,
:class => 'rateable',
:id => nil
}.update(opts)

content_tag :div, "", "data-average" => obj.average(options[:dimension]) ? obj.average(options[:dimension]).avg : 0, :id => options[:id],
:class => "#{options[:class]}#{jdisabled?(options[:static])}",
"data-id" => obj.id, "data-kls" => obj.class.name, "data-dimension" => options[:dimension]
end

def seems_rateable_stylesheet
stylesheet_link_tag "seems_rateable/jRating.jquery"
end

private
def jdisabled?(option)
" jDisabled" if option || !current_user
end
end
end

0 comments on commit d2da2a8

Please sign in to comment.