{"id":13879856,"url":"https://github.com/thoughtbot/croutons","last_synced_at":"2025-07-16T16:30:26.137Z","repository":{"id":20431686,"uuid":"23708352","full_name":"thoughtbot/croutons","owner":"thoughtbot","description":"Easy breadcrumbs for Ruby on Rails web applications","archived":true,"fork":false,"pushed_at":"2024-09-19T22:30:03.000Z","size":41,"stargazers_count":51,"open_issues_count":0,"forks_count":10,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-06-26T07:02:38.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thoughtbot.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thoughtbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-05T15:37:52.000Z","updated_at":"2024-09-19T22:33:12.000Z","dependencies_parsed_at":"2024-08-16T21:37:19.251Z","dependency_job_id":null,"html_url":"https://github.com/thoughtbot/croutons","commit_stats":{"total_commits":34,"total_committers":6,"mean_commits":5.666666666666667,"dds":0.6470588235294117,"last_synced_commit":"52ac4069471a78ed132b3ed3a72da33f3a6bdbdb"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thoughtbot/croutons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fcroutons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fcroutons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fcroutons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fcroutons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtbot","download_url":"https://codeload.github.com/thoughtbot/croutons/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2Fcroutons/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524594,"owners_count":23782007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:02:36.133Z","updated_at":"2025-07-16T16:30:25.822Z","avatar_url":"https://github.com/thoughtbot.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"## Deprecated as of September 20, 2024\n\nThis project is no longer maintained. If you wish to continue to develop this code yourself, we recommend you fork it.\n\nCroutons\n========\n\nEasy breadcrumbs for Rails apps.\n\nUsage\n-----\n\n### Required steps\n\n1. Include `Croutons::Controller` in your `ApplicationController`.\n\n   This will make a `#breadcrumbs` helper available in your layouts and views.\n2. Call the `#breadcrumbs` helper in your layouts or views.\n3. Define a `BreadcrumbTrail` class, which inherits from\n   `Croutons::BreadcrumbTrail`.\n4. Define missing methods on the `BreadcrumbTrail` class.\n\n   For example, for the `admin/locations/index.html.erb` view you would define\n   an `#admin_locations_index` method.\n\n   In these methods, you build up a breadcrumb trail by calling `#breadcrumb`\n   with a label and an optional URL. You can also call previously defined\n   methods to build on existing trails. View assigns (i.e. the controller\n   instance variables) are available via the `#objects` method which returns a\n   `Hash`. Rails route helpers are also available inside this class.\n\nPlease see [the example below](#example) for further reference.\n\n### Optional steps\n\n* Instead of defining a `BreadcrumbTrail` class you can use an object of your\n  own that responds to `#breadcrumbs`.\n\n  To do this, override the private `#breadcrumb_trail` method in the controller\n  where you included `Croutons::Controller`, to return the object you want to\n  use.\n\n  The `#breadcrumbs` method is passed two parameters: one `template_identifier`\n  `String` and one `objects` `Hash`. The `#breadcrumbs` method should return an\n  `Array` of `Croutons::Breadcrumb`s.\n\n* Override the view used to render breadcrumbs.\n\n  To do this, create a view called `breadcrumbs/_breadcrumbs.html.erb`.\n\n  In this view, an `Array` of `Croutons::Breadcrumb`s is assigned to the local\n  variable `breadcrumbs`. These `Croutons::Breadcrumb`s have two public\n  attributes: `#label` and `#url`. The `#url` attribute is optional. To check\n  whether the `Croutons::Breadcrumb` has a `#url` or not (i.e. should be\n  rendered as a link or not), check whether the `#link?` method returns `true`\n  or `false`.\n\n### Example\n\n#### `app/controllers/application_controller.rb`\n\n    class ApplicationController \u003c ActionController::Base\n      include Croutons::Controller\n    end\n\n#### `app/controllers/posts_controller.rb`\n\n    class PostsController \u003c ApplicationController\n      def index\n        @posts = Post.all\n      end\n\n      def show\n        @post = Post.find(params[:id])\n      end\n    end\n\n#### `app/views/layouts/application.html.erb`\n\n    \u003c!DOCTYPE html\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003ctitle\u003eMy blog\u003c/title\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n        \u003c%= breadcrumbs %\u003e\n        \u003c%= yield %\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n\n#### `app/models/breadcrumb_trail.rb`\n\n    class BreadcrumbTrail \u003c Croutons::BreadcrumbTrail\n      def posts_index\n        breadcrumb(\"Posts\", posts_path)\n      end\n\n      def posts_show\n        posts_index\n        breadcrumb(objects[:post].title, post_path(objects[:post]))\n      end\n    end\n\nLicense\n-------\n\nCroutons is Copyright © 2014 Calle Erlandsson, George Brocklehurst, and\nthoughtbot. It is free software, and may be redistributed under the terms\nspecified in the LICENSE file.\n\n\u003c!-- START /templates/footer.md --\u003e\n## About thoughtbot\n\n![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)\n\nThis repo is maintained and funded by thoughtbot, inc.\nThe names and logos for thoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software!\nSee [our other projects][community].\nWe are [available for hire][hire].\n\n[community]: https://thoughtbot.com/community?utm_source=github\n[hire]: https://thoughtbot.com/hire-us?utm_source=github\n\n\n\u003c!-- END /templates/footer.md --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2Fcroutons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtbot%2Fcroutons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2Fcroutons/lists"}