Sha256: 3af705da0d4a0eec68963a339c377eb50d0a9fa1c37dd39d9e7da133e7381f9a

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

module EasyAsPie
  module ViewHelper

    # <div class="treeview" data-percent="73">73%</div>
    def rails_treeview percent, *args
      raise ArgumentError, "Must take a percent argument" unless percent
      pie_options = {:"data-percent" => percent, :class => 'treeview'}
      
      options = args.extract_options!
      pie_options.merge!(options || {})

      label = args.first || "#{percent}%"

      content_tag :div, label, pie_options
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_treeview-0.1.2 lib/rails_treeview/view_helper.rb
rails_treeview-0.1.1 lib/rails_treeview/view_helper.rb