Progress Bar in Rails
Ever thought of implementing a progress bar in rails? or did a need arise for you to do the same?
Something like if you want the user to show the progress bar while he is uploading the file and so on
Well there is a plugin available which will help you to do the same.. Here are the details for it
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)
Njoi A gr8 progress bar.
Thanks
Dhaval Parikh
http://www.dhavalparikh.co.in