Module: ReviewsHelper

Defined in:
app/helpers/reviews_helper.rb

Instance Method Summary collapse

Instance Method Details

#mk_stars(m) ⇒ Object



7
8
9
# File 'app/helpers/reviews_helper.rb', line 7

def mk_stars(m)
  (1..5).collect {|n| n <= m ? star("lit") : star("unlit") }.join
end

#star(the_class) ⇒ Object



3
4
5
# File 'app/helpers/reviews_helper.rb', line 3

def star(the_class) 
  "<span class=\"#{the_class}\"> &#10030; </span>"
end

#txt_stars(n, show_out_of = true) ⇒ Object



11
12
13
14
15
# File 'app/helpers/reviews_helper.rb', line 11

def txt_stars(n, show_out_of = true)
  res = I18n.t('star', :count => n)
  res += ' ' + t('out_of_5') if show_out_of
  res
end