Source Browser

<h1>Code Examples</h1>
<% if @tags.any? %>
<div class="tag-filters">
<%= link_to "All", examples_path, class: "tag-filter #{@tag.blank? ? 'active' : ''}" %>
<% @tags.each do |tag| %>
<%= link_to tag, examples_path(tag: tag), class: "tag-filter #{@tag == tag ? 'active' : ''}" %>
<% end %>
</div>
<% end %>
<% if @examples.any? %>
<div class="examples-grid">
<% @examples.each do |example| %>
<article>
<h3><%= link_to example.title, example_path(slug: example.slug) %></h3>
<p><%= example.description %></p>
<div>
<% example.tags.each do |tag| %>
<span class="tag"><%= tag %></span>
<% end %>
</div>
</article>
<% end %>
</div>
<% else %>
<p>No examples found.<%= " Try a different tag." if @tag.present? %></p>
<% end %>

← Back