File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,25 @@ And then execute:
16
16
$ bundle
17
17
18
18
## Usage
19
-
19
+ * The following examples assume that we are setting up ajax-datatables-rails for an index of users from a ` User ` model *
20
20
### Model
21
21
Run the following command:
22
22
23
- rails generate ajaxdatatable <modelname>
23
+ $ rails generate ajaxdatatable User
24
+
25
+ This will generate a file named ` users_datatable.rb ` in ` app/datatables ` . Open the file and customize in the functions as directed by the comments
26
+
27
+ #### Initializer
28
+ ``` ruby
29
+ def initialize (view )
30
+ @model_name = User
31
+ @columns = # insert array of column names here
32
+ @searchable_columns = # insert array of columns that will be searched
33
+ super (view)
34
+ end
35
+ ```
36
+
24
37
25
- This will generate a file in ` app/datatables `
26
38
## Contributing
27
39
28
40
1 . Fork it
You can’t perform that action at this time.
0 commit comments