Skip to content

changed a method name #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ajax-datatables-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def as_json(options = {})
{
sEcho: params[:sEcho].to_i,
iTotalRecords: @model_name.count,
iTotalDisplayRecords: get_raw_record_count,
iTotalDisplayRecords: filtered_record_count,
aaData: data
}
end
Expand All @@ -35,7 +35,7 @@ def get_raw_records
raise MethodError, "The method `get_raw_records' is not defined."
end

def get_raw_record_count
def filtered_record_count
search_records(get_raw_records).count
end

Expand Down
4 changes: 4 additions & 0 deletions lib/generators/ajaxdatatable/templates/datatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ def get_raw_records
# insert query here
end

def get_raw_record_count
search_records(get_raw_records).count
end

# ==== Insert 'presenter'-like methods below if necessary
end