Skip to content

Commit

Permalink
added to rEADME
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Quenneville committed Apr 30, 2012
1 parent 0968543 commit 68c7dcf
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,25 @@ And then execute:
$ bundle

## Usage

*The following examples assume that we are setting up ajax-datatables-rails for an index of users from a `User` model*
### Model
Run the following command:

rails generate ajaxdatatable <modelname>
$ rails generate ajaxdatatable User

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

#### Initializer
```ruby
def initialize(view)
@model_name = User
@columns = # insert array of column names here
@searchable_columns = #insert array of columns that will be searched
super(view)
end
```


This will generate a file in `app/datatables`
## Contributing

1. Fork it
Expand Down

0 comments on commit 68c7dcf

Please sign in to comment.