Skip to content

Instantly share code, notes, and snippets.

View simptive's full-sized avatar
🎯
Focusing

Yasir Mahmood simptive

🎯
Focusing
View GitHub Profile
@simptive
simptive / layout.html.rb
Last active December 10, 2023 18:07
Dynamic Breadcrumbs / Navigation history in Rails
<%# Relevant methods/vars: heading, navigation_add, render_navigation %>
<!DOCTYPE html>
<html>
<%# header content %>
<body>
<section class="content-header">
<% heading = yield(:heading).truncate(30) %>
<h1><%= heading %></h1>
<% navigation_add (heading), request.fullpath %>
<%= render_navigation %>