Skip to content

Instantly share code, notes, and snippets.

@pgdaniel
Created March 15, 2016 08:44
Show Gist options
  • Save pgdaniel/652e39c9b199ffb10191 to your computer and use it in GitHub Desktop.
Save pgdaniel/652e39c9b199ffb10191 to your computer and use it in GitHub Desktop.
cheap breadcrumb view helper to use with wicked wizard and bootstrap (for laters)
<ol class="breadcrumb">
<%= generate_breadcrumbs %>
</ol>
def generate_breadcrumbs
wizard_steps.collect do |step|
active_path = 'active' if current_page? wizard_path(step)
humanized_step = step.to_s.humanize
content_tag(:li, class: active_path) do
active_path ? humanized_step : link_to(humanized_step, wizard_path(step))
end
end.join('').to_s.html_safe
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment