Progress Bar in Ruby on Rails

By , January 7, 2009 10:35 am

ProgressBar Plugin:

Install:
ruby script/plugin install http://progressbarhelper.googlecode.com/svn/trunk/progress_bar_helper/

#View -

Include JS Files

<%=javascript_include_tag "progress_bar/jsProgressBarHandler.js"%>

Custom Static Progress Bar:

custom_static_progress_bar(name, value, options = {})

Options are:

# * name : used as an id for the progress bar

# * value : decimal value to represent (i.e. value <= 1)

# * options : rendering options

#

# Rendering options are:

# * show_text : set to true to display percentage value in a text form

# * animate : set to true to animate the image

# * width : sets the width of the image (!must be the same as the actual box_image width

# * height : sets the height of the image (!must be the same as the actual box_image height

# * box_image : sets the container image

# * bar_images : sets the progress bar images (must be an Array)

Example:

<%=custom_static_progress_bar("a2",1.0,{:show_text=>"Test",:animate=>true,:width=>120,:height=>12})%>

Progress Bar:

progress_bar(name,value, display_percentage_text = false, multicolor = false)

Panorama Theme by Themocracy