Module: EasyAsPie::ViewHelper
- Defined in:
- lib/easy_as_pie/view_helper.rb
Instance Method Summary collapse
-
#easy_as_pie(percent, *args) ⇒ Object
<div class=“chart” data-percent=“73”>73%</div>.
Instance Method Details
#easy_as_pie(percent, *args) ⇒ Object
<div class=“chart” data-percent=“73”>73%</div>
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/easy_as_pie/view_helper.rb', line 5 def easy_as_pie percent, *args raise ArgumentError, "Must take a percent argument" unless percent = {:"data-percent" => percent, :class => 'chart'} = args. .merge!( || {}) label = args.first || "#{percent}%" content_tag :div, label, end |