Module: ProgressBarSnapshotHelper
- Defined in:
- lib/progress_bar_snapshot_helper.rb
Overview
need a controler action to actually do the image generation and sending of the image blob. See README for examples.
Instance Method Summary collapse
Instance Method Details
#progress_bar_png_tag(percent, opts = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/progress_bar_snapshot_helper.rb', line 8 def (percent, opts = {}) url = { :percentage => percent } = url.merge(opts) # extra html attributes for the image tag attributes = %(class="#{[:class] || 'progressbar'}" alt="#{percent.round}%" ) attributes << %(title="#{[:title]}" ) if [:title] %(<img src="#{ url_for }" #{attributes}/>) end |