diff --git a/app/controllers/components_controller.rb b/app/controllers/components_controller.rb index b466c8f..5816f84 100644 --- a/app/controllers/components_controller.rb +++ b/app/controllers/components_controller.rb @@ -1,5 +1,5 @@ class ComponentsController < ApplicationController - @@available_templates = %w[toggle select tabs] + @@available_templates = %w[toggle select tabs navigation] def index @available_templates = @@available_templates end diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb new file mode 100644 index 0000000..2198602 --- /dev/null +++ b/app/helpers/breadcrumbs_helper.rb @@ -0,0 +1,8 @@ +module BreadcrumbsHelper + # set_breadcrumbs [[name1, url1], [name2, url2], ...] + def set_breadcrumbs(breadcrumbs_array) + content_for(:breadcrumbs) do + render "breadcrumbs", breadcrumbs: breadcrumbs_array + end + end +end diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 13c4e98..4722524 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -7,6 +7,9 @@ import { application } from "./application" import HelloController from "./hello_controller" application.register("hello", HelloController) +import NavbarController from "./navbar_controller" +application.register("navbar", NavbarController) + import SelectMenuController from "./select_menu_controller" application.register("select-menu", SelectMenuController) diff --git a/app/javascript/controllers/navbar_controller.js b/app/javascript/controllers/navbar_controller.js new file mode 100644 index 0000000..538c453 --- /dev/null +++ b/app/javascript/controllers/navbar_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +// Connects to data-controller="navbar" +export default class extends Controller { + connect() { + } +} diff --git a/app/views/application/_breadcrumbs.erb b/app/views/application/_breadcrumbs.erb new file mode 100644 index 0000000..045b51d --- /dev/null +++ b/app/views/application/_breadcrumbs.erb @@ -0,0 +1,27 @@ +<%# locals: (breadcrumbs: []) %> + diff --git a/app/views/components/_template.html.erb b/app/views/components/_template.html.erb index 819be71..5391c5a 100644 --- a/app/views/components/_template.html.erb +++ b/app/views/components/_template.html.erb @@ -1,5 +1,7 @@ <%# locals:(title:, description:) %> +<% content_for(:title, "#{title} | Tailwind, ERB & Stimulus") %> +
+ This site provides examples of Tailwind widgets using Simulus for animation and responsiveness. +
+ +