We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
before_action :set_progress, only: [:show] private def set_progress if wizard_steps.any? && wizard_steps.index(step).present? @progress = ((wizard_steps.index(step) + 1).to_d / wizard_steps.count.to_d) * 100 else @progress = 0 end end 2. your_wizard_view.html.haml: (using bootstrap + haml)
before_action :set_progress, only: [:show] private def set_progress if wizard_steps.any? && wizard_steps.index(step).present? @progress = ((wizard_steps.index(step) + 1).to_d / wizard_steps.count.to_d) * 100 else @progress = 0 end end
.progress .progress-bar{style: "width: #{@progress}%"}