Skip to content

bsa7/ransack-errors-example

Repository files navigation

README

This example demonstrates validations of ransack search form.

To run example:

  1. download it from github:
mkdir ~ && git clone [email protected]:r72cccp/ransack-errors-example.git && cd ransack-errors-example
  1. install and run migrations:
bundle
rails db:migrate
  1. create something companies:
RAILS_ENV=development bundle exec rails c
Running via Spring preloader in process 170803
Loading development environment (Rails 6.1.4.4)
2.6.5 :001 > Company.create(name: 'aaa')
2.6.5 :002 > Company.create(name: 'aaabbb')
2.6.5 :003 > Company.create(name: 'ccceeefff')
  1. run rails server:
rails server
  1. visit companies page:
http://localhost:3000/companies

You would see the next: example

The CompanySearchForm validates only length. If searched string is greater than 5 symbols, you must see the error.

About

demonstrates validation of ransack form

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published