{"id":17826429,"url":"https://github.com/groony/activeadmin-dry-validation","last_synced_at":"2025-03-18T23:31:02.356Z","repository":{"id":62552717,"uuid":"139644767","full_name":"groony/activeadmin-dry-validation","owner":"groony","description":"Validate your ActiveAdmin resources through dry-validation","archived":false,"fork":false,"pushed_at":"2018-07-05T21:47:23.000Z","size":44,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T04:21:22.263Z","etag":null,"topics":["activeadmin","rails","ruby","schema"],"latest_commit_sha":null,"homepage":"https://github.com/groony/activeadmin-dry-validation","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/groony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-03T23:00:49.000Z","updated_at":"2023-03-09T07:09:47.000Z","dependencies_parsed_at":"2022-11-03T04:15:30.846Z","dependency_job_id":null,"html_url":"https://github.com/groony/activeadmin-dry-validation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groony%2Factiveadmin-dry-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groony%2Factiveadmin-dry-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groony%2Factiveadmin-dry-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groony%2Factiveadmin-dry-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groony","download_url":"https://codeload.github.com/groony/activeadmin-dry-validation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244325267,"owners_count":20435077,"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":["activeadmin","rails","ruby","schema"],"created_at":"2024-10-27T18:47:49.200Z","updated_at":"2025-03-18T23:31:01.928Z","avatar_url":"https://github.com/groony.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Activeadmin::Dry::Validation\n\n[![Gem Version](https://badge.fury.io/rb/activeadmin-dry-validation.svg)](https://badge.fury.io/rb/activeadmin-dry-validation) ![travis](https://travis-ci.com/groony/activeadmin-dry-validation.svg?branch=master)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activeadmin-dry-validation'\n```\n\n## Usage\n\n```ruby\nActiveAdmin.register SomeResource do\n  permit_params :title, :announcement, :some_attr\n  \n  schema do\n    required(:announcement).filled(:str?)\n    required(:title).filled(:str?)\n    required(:some_attr).filled(:str?)\n  end\n  \n  form do |f|\n    f.semantic_errors(*f.object.errors.keys)\n    f.inputs do\n      f.input :title\n      f.input :announcement, as: :text\n    end\n  end\nend\n```\n\nIf you have outer schema you can use it too\n\n```ruby\nouter_schema = ::Dry::Validation.Schema(::Dry::Validation::Schema::Params) do\n  required(:announcement).filled(:str?)\n  required(:title).filled(:str?)\n  required(:some_attr).filled(:str?)\nend\n\nschema(outer_schema: outer_schema)\n```\n\nNow when you will try to create or update resource, it will be validated by schema.\n\n\n### Customizing error messages\n\nCreate `config/initializers/dry-validation.rb`\n\n\n```ruby\nDry::Validation::Schema::Params.configure do |config|\n  config.messages_file = Rails.root.join('config', 'locales', 'errors.yml')\nend\n```\n\nCreate `config/locales/errors.yml` from [source](https://github.com/dry-rb/dry-validation/blob/master/config/errors.yml).\n\nNow you can customize basic errors.\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/groony/activeadmin-dry-validation.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroony%2Factiveadmin-dry-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroony%2Factiveadmin-dry-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroony%2Factiveadmin-dry-validation/lists"}