Skip to content

Commit

Permalink
Merge pull request #4 from JoelQ/generators
Browse files Browse the repository at this point in the history
added a method to count filtered records
  • Loading branch information
Joel Quenneville committed Apr 30, 2012
2 parents cea90f1 + 89e7526 commit 0f2878c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
14 changes: 10 additions & 4 deletions lib/ajax-datatables-rails.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# require 'rails'

class AjaxDatatablesRails

class MethodError < StandardError; end

VERSION = '0.0.1'

attr_reader :columns, :model_name, :searchable_columns

def initialize(view)
@view = view
end

attr_reader :columns, :model_name, :searchable_columns

def method_missing(meth, *args, &block)
@view.send(meth, *args, &block)
Expand All @@ -25,12 +27,16 @@ def as_json(options = {})

private

def data
raise MethodError, "The method `data' is not defined."
end

def get_raw_records
raise
raise MethodError, "The method `get_raw_records' is not defined."
end

def get_raw_record_count
raise
search_records(get_raw_records).count
end

def fetch_records
Expand Down
8 changes: 0 additions & 8 deletions lib/generators/filterdatatable/filterdatatable.rb

This file was deleted.

0 comments on commit 0f2878c

Please # to comment.