Skip to content

Commit

Permalink
Do not explicitly require jquery-rails
Browse files Browse the repository at this point in the history
Since CSV can also be loaded via Webpacker, jquery-rails dependency
should be an optional dependency.
  • Loading branch information
tagliala committed Apr 26, 2020
1 parent 8b554ea commit d4ba179
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master / unreleased

* [FEATURE] Drop Ruby 2.3 support
* [FEATURE] Do not require `jquery-rails` gem ([#785](https://github.com/DavyJonesLocker/client_side_validations/pull/785))
* [FEATURE] Add support for many association validations ([#783](https://github.com/DavyJonesLocker/client_side_validations/pull/783))

## 16.2.0 / 2020-04-10
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,26 @@ attach its event handlers.

#### When using Sprockets ####

Make sure that you are requiring jQuery.
Since ClientSideValidations can also be used via webpacker, it does not require
by default `jquery-rails` gem.

Make sure that `jquery-rails` is part of your bundled gems and `application.js`,
otherwise add:

```ruby
gem 'jquery-rails', '~> 4.3'
```

to your `Gemfile`, run `bundle`, and add

```js
//= require jquery
```

to your `app/assets/javascripts/application.js` file.

Add the following to your `app/assets/javascripts/application.js` file.
Then, add the following to your `app/assets/javascripts/application.js` file
after `//= require jquery`.

```js
//= require rails.validations
Expand Down
1 change: 0 additions & 1 deletion client_side_validations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Gem::Specification.new do |spec|

spec.add_dependency 'rails', '>= 5.0.0.1', '< 6.1'

spec.add_dependency 'jquery-rails', '~> 4.3'
spec.add_dependency 'js_regex', '~> 3.1'

spec.add_development_dependency 'appraisal', '~> 2.2'
Expand Down

0 comments on commit d4ba179

Please sign in to comment.