{"id":17773899,"url":"https://github.com/svenfuchs/simple_slugs","last_synced_at":"2025-03-15T16:32:37.753Z","repository":{"id":998226,"uuid":"809465","full_name":"svenfuchs/simple_slugs","owner":"svenfuchs","description":null,"archived":false,"fork":false,"pushed_at":"2010-11-20T22:25:21.000Z","size":112,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-19T09:06:43.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"codegangsta/cli","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svenfuchs.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-07-31T16:51:38.000Z","updated_at":"2016-09-22T18:47:39.000Z","dependencies_parsed_at":"2022-07-06T01:00:29.943Z","dependency_job_id":null,"html_url":"https://github.com/svenfuchs/simple_slugs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenfuchs%2Fsimple_slugs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenfuchs%2Fsimple_slugs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenfuchs%2Fsimple_slugs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenfuchs%2Fsimple_slugs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svenfuchs","download_url":"https://codeload.github.com/svenfuchs/simple_slugs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221588262,"owners_count":16848286,"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-10-26T21:47:11.264Z","updated_at":"2024-10-26T21:47:11.678Z","avatar_url":"https://github.com/svenfuchs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. SimpleSlugs\n\nsimple_slugs aims to be an as-simple-as-possible implementation of slugging/permalink functionality for ActiveRecord 3, but still be I18n-ready by providing transliteration support.\n\nh2. Usage\n\nsimple_slugs adds an act_macro to activate slugging support for an ActiveRecord model:\n\n\u003cpre\u003e\n  class Post\n    has_slug\n  end\n\u003c/pre\u003e\n\nsimple_slugs has the following assumptions/defaults:\n\n* The model has a column named \"slug\" which is used for the slug.\n* The model has a column named \"title\" or \"name\" which is used as a source for the slug.\n* There's no scope to be taken into account when checking for uniqueness of slugs.\n* The slug only needs to be updated if the slug column is blank.\n\nYou can overwrite these defaults as follows:\n\n\u003cpre\u003e\n  class Post\n    has_slug :slug_name =\u003e :permalink,  # use the permalink column for storing the slug\n             :source    =\u003e :heading,    # use the heading column as a source\n             :on_blank  =\u003e false,       # always update the slug\n             :scope     =\u003e :blog_id     # scope uniqueness of slugs to the current blog_id\n  end\n\u003c/pre\u003e\n\nh2. Slugging\n\nsimple_slugs performs the following operations on the source value (e.g. post.title):\n\n\u003cpre\u003e\n  transliterate! # using the current locale, e.g. German \"Ä\" =\u003e \"Ae\"\n  spacify!       # replace everything except word chars with spaces\n  join_spaces!   # replace duplicate spaces with single spaces\n  strip!         # strip leading and tailing spaces\n  downcase!      # downcase the string\n  dasherize!     # replace spaces with dashes\n\u003c/pre\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenfuchs%2Fsimple_slugs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvenfuchs%2Fsimple_slugs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenfuchs%2Fsimple_slugs/lists"}