[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7696":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":33,"discoverSource":34},7696,"friendly_id","norman\u002Ffriendly_id","norman","FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.","http:\u002F\u002Fnorman.github.io\u002Ffriendly_id\u002F",null,"Ruby",6227,589,54,27,0,2,11,39.31,"MIT License",false,"master",true,[25,26,27,28,29],"friendly-url","plugin","rails","ruby","slug","2026-06-12 02:01:43","[![Build Status](https:\u002F\u002Fgithub.com\u002Fnorman\u002Ffriendly_id\u002Fworkflows\u002FCI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fnorman\u002Ffriendly_id\u002Factions)\n[![Code Climate](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fnorman\u002Ffriendly_id.svg)](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fnorman\u002Ffriendly_id)\n[![Inline docs](https:\u002F\u002Finch-ci.org\u002Fgithub\u002Fnorman\u002Ffriendly_id.svg?branch=master)](https:\u002F\u002Finch-ci.org\u002Fgithub\u002Fnorman\u002Ffriendly_id)\n\n# FriendlyId\n\n**For the most complete, user-friendly documentation, see the [FriendlyId Guide](https:\u002F\u002Fnorman.github.io\u002Ffriendly_id\u002Ffile.Guide.html).**\n\nFriendlyId is the \"Swiss Army bulldozer\" of slugging and permalink plugins for\nActive Record. It lets you create pretty URLs and work with human-friendly\nstrings as if they were numeric ids.\n\nWith FriendlyId, it's easy to make your application use URLs like:\n\n    https:\u002F\u002Fexample.com\u002Fstates\u002Fwashington\n\ninstead of:\n\n    https:\u002F\u002Fexample.com\u002Fstates\u002F4323454\n\n\n## Getting Help\n\nAsk questions on [Stack Overflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Ffriendly-id)\nusing the \"friendly-id\" tag, and for bugs have a look at [the bug section](https:\u002F\u002Fgithub.com\u002Fnorman\u002Ffriendly_id#bugs)\n\n## FriendlyId Features\n\nFriendlyId offers many advanced features, including:\n\n * slug history and versioning\n * i18n\n * scoped slugs\n * reserved words\n * custom slug generators\n\n## Usage\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'friendly_id', '~> 5.5.0'\n```\n\nNote: You MUST use 5.0.0 or greater for Rails 4.0+.\n\nAnd then execute:\n\n```shell\nbundle install\n```\n\nAdd a `slug` column to the desired table (e.g. `Users`)\n```shell\nrails g migration AddSlugToUsers slug:uniq\n```\n\nGenerate the friendly configuration file and a new migration\n\n```shell\nrails generate friendly_id\n```\n\nNote: You can delete the `CreateFriendlyIdSlugs` migration if you won't use the slug history feature. ([Read more](https:\u002F\u002Fnorman.github.io\u002Ffriendly_id\u002FFriendlyId\u002FHistory.html))\n\nRun the migration scripts\n\n```shell\nrails db:migrate\n```\n\nEdit the `app\u002Fmodels\u002Fuser.rb` file as the following:\n\n```ruby\nclass User \u003C ApplicationRecord\n  extend FriendlyId\n  friendly_id :name, use: :slugged\nend\n```\n\nEdit the `app\u002Fcontrollers\u002Fusers_controller.rb` file and replace `User.find` by `User.friendly.find`\n\n```ruby\nclass UserController \u003C ApplicationController\n  def show\n    @user = User.friendly.find(params[:id])\n  end\nend\n```\n\nNow when you create a new user like the following:\n\n```ruby\nUser.create! name: \"Joe Schmoe\"\n```\n\nYou can then access the user show page using the URL http:\u002F\u002Flocalhost:3000\u002Fusers\u002Fjoe-schmoe.\n\n\nIf you're adding FriendlyId to an existing app and need to generate slugs for\nexisting users, do this from the console, runner, or add a Rake task:\n\n```ruby\nUser.find_each(&:save)\n```\n\n## Options\n\n### `:allow_nil`\n\nYou can pass `allow_nil: true` to the `friendly.find()` method if you want to\navoid raising `ActiveRecord::RecordNotFound` and accept `nil`.\n\n#### Example\n\n```ruby\nMyModel.friendly.find(\"bad-slug\") # where bad-slug is not a valid slug\nMyModel.friendly.find(123)        # where 123 is not a valid primary key ID\nMyModel.friendly.find(nil)        # maybe you have a variable\u002Fparam that's potentially nil\n#=> raise ActiveRecord::RecordNotFound\n\nMyModel.friendly.find(\"bad-slug\", allow_nil: true)\nMyModel.friendly.find(123, allow_nil: true)\nMyModel.friendly.find(nil, allow_nil: true)\n#=> nil\n```\n\n## Bugs\n\nPlease report them on the [Github issue\ntracker](https:\u002F\u002Fgithub.com\u002Fnorman\u002Ffriendly_id\u002Fissues) for this project.\n\nIf you have a bug to report, please include the following information:\n\n* **Version information for FriendlyId, Rails and Ruby.**\n* Full stack trace and error message (if you have them).\n* Any snippets of relevant model, view or controller code that shows how you\n  are using FriendlyId.\n\nIf you are able to, it helps even more if you can fork FriendlyId on Github,\nand add a test that reproduces the error you are experiencing.\n\nFor more inspiration on how to report bugs, please see [this\narticle](https:\u002F\u002Fwww.chiark.greenend.org.uk\u002F~sgtatham\u002Fbugs.html).\n\n## Thanks and Credits\n\nFriendlyId was originally created by Norman Clarke and Adrian Mugnolo, with\nsignificant help early in its life by Emilio Tagua. It is now maintained by\nNorman Clarke and Philip Arndt.\n\nWe're deeply grateful for the generous contributions over the years from [many\nvolunteers](https:\u002F\u002Fgithub.com\u002Fnorman\u002Ffriendly_id\u002Fcontributors).\n\n## License\n\nCopyright (c) 2008-2020 Norman Clarke and contributors, released under the MIT\nlicense.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and\u002For sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","FriendlyId 是一个用于 ActiveRecord 的 slug 和永久链接插件，它能够帮助开发者创建美观的 URL，并以人类可读的字符串代替数字 ID。其核心功能包括 slug 历史记录和版本控制、国际化支持、范围 slug、保留字以及自定义 slug 生成器等。该工具特别适合需要优化用户体验的应用场景，例如博客平台、电子商务网站或任何希望使用更友好 URL 结构的 Rails 项目中。通过简单的配置即可集成到现有应用中，使用户能够通过易记且有意义的网址访问资源。","2026-06-11 03:13:50","top_language"]