You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-33Lines changed: 3 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,38 +42,6 @@ You'll find a sample project here : https://ajax-datatables-rails.herokuapp.com
42
42
43
43
Its real world examples. The code is here : https://github.com/jbox-web/ajax-datatables-rails-sample-project
44
44
45
-
## Warnings
46
-
47
-
**Breaking changes :**
48
-
49
-
1) the *v1.0.0* version is a **major break** from *v0.4*.
50
-
51
-
* Datatables no longer inherits from `AjaxDatatablesRails::Base` but from `AjaxDatatablesRails::ActiveRecord` (this solves [#228](https://github.com/jbox-web/ajax-datatables-rails/issues/228))
52
-
* The `view_context` is no longer injected in Datatables but only the `params` hash (see the [example](#4-setup-the-controller-action)). This will break calls to helpers methods.
53
-
54
-
To mitigate this 2 changes see the [migration doc](/doc/migrate.md).
55
-
56
-
2) the *v0.4* version is a **major break** from *v0.3*.
57
-
58
-
The core has been rewriten to remove dependency on [Kaminari](https://github.com/kaminari/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate).
59
-
60
-
It also brings a new (more natural) way of defining columns, based on hash definitions (and not arrays) and add some filtering options for column search.
61
-
62
-
[See below](#3-customize-the-generated-datatables-class) for more infos.
63
-
64
-
To migrate on the v0.4 you'll need to :
65
-
66
-
* update your DataTables classes to remove all the `extend` directives
67
-
* switch to hash definitions of `view_columns`
68
-
* update your views to declare your columns bindings ([See here](#5-wire-up-the-javascript))
69
-
70
-
71
-
## Documentation version
72
-
73
-
This documentation is about the `v1.x.x` release (master branch) of this gem.
74
-
75
-
You can still have access to the `v0.4.x` documentation on the [v0.4.x branch](https://github.com/jbox-web/ajax-datatables-rails/tree/v0.4.x).
*`Proc` for whatever (see [here](https://github.com/ajahongir/ajax-datatables-rails-v-0-4-0-how-to/blob/master/app/datatables/city_datatable.rb) for real example)
204
172
173
+
The `nulls_last` param allows for nulls to be ordered last.
174
+
205
175
See [here](#columns-syntax) to get more details about columns definitions and how to play with associated models.
206
176
207
177
You can customize or sanitize the search value passed to the DB by using the `:formatter` option with a lambda :
Copy file name to clipboardExpand all lines: doc/migrate.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
## To migrate from `v0.4.x` to `v1.0.0`
2
2
3
+
The *v1.0.0* version is a **major break** from *v0.4*.
4
+
5
+
* Datatables no longer inherits from `AjaxDatatablesRails::Base` but from `AjaxDatatablesRails::ActiveRecord` (this solves [#228](https://github.com/jbox-web/ajax-datatables-rails/issues/228))
6
+
* The `view_context` is no longer injected in Datatables but only the `params` hash (see the [example](#4-setup-the-controller-action)). This will break calls to helpers methods.
7
+
3
8
1) To mitigate the first change (Datatables no longer inherits from `AjaxDatatablesRails::Base` but from `AjaxDatatablesRails::ActiveRecord`)
4
9
5
10
Create a new `ApplicationDatatable` class and make all your classes inherits from it :
@@ -51,3 +56,17 @@ end
51
56
This way, you can still use `def_delegators` in your datatables [as in the documentation](https://github.com/jbox-web/ajax-datatables-rails#using-view-helpers).
52
57
53
58
Note that the recommanded way is to use [Draper gem](https://github.com/drapergem/draper) to separate filtering logic from view/presentation logic [as in the documentation](https://github.com/jbox-web/ajax-datatables-rails#using-view-decorators).
59
+
60
+
## To migrate from `v0.3.x` to `v0.4.x`
61
+
62
+
The *v0.4* version is a **major break** from *v0.3*.
63
+
64
+
The core has been rewriten to remove dependency on [Kaminari](https://github.com/kaminari/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate).
65
+
66
+
It also brings a new (more natural) way of defining columns, based on hash definitions (and not arrays) and add some filtering options for column search.
67
+
68
+
To migrate on the v0.4 you'll need to :
69
+
70
+
* update your DataTables classes to remove all the `extend` directives
71
+
* switch to hash definitions of `view_columns`
72
+
* update your views to declare your columns bindings ([See here](https://github.com/jbox-web/ajax-datatables-rails#5-wire-up-the-javascript))
0 commit comments