Skip to content

Commit faa2779

Browse files
committed
Update README
1 parent 719d623 commit faa2779

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,22 @@ database.
665665

666666
## Pro Tips
667667

668+
### Create a master parent class
669+
670+
In the same spirit of Rails `ApplicationController` and `ApplicationRecord`, you can create an `ApplicationDatatable` class (in `app/datatables/application_datatable.rb`)
671+
that will be inherited from other classes :
672+
673+
```ruby
674+
class ApplicationDatatable < AjaxDatatablesRails::ActiveRecord
675+
# puts commonly used methods here
676+
end
677+
678+
class PostDatatable < ApplicationDatatable
679+
end
680+
```
681+
682+
This way it will be easier to DRY you datatables.
683+
668684
### Create indices for Postgresql
669685

670686
In order to speed up the `ILIKE` queries that are executed when using the default configuration, you might want to consider adding some indices.

0 commit comments

Comments
 (0)