Git Product home page Git Product logo

data_table's Introduction

Hi there ๐Ÿ‘‹

data_table's People

Contributors

asceth avatar jasondew avatar jeanmertz avatar killthekitten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

data_table's Issues

Searching on a joined table

First of all I wanted to thank you for this great gem. It's saved me a lot of time that I used to use building data tables by hand. I have one issue though and that's with using the search on a joined table and I was wondering if there's something I'm missing.

I have two tables Users and Roles. They're related as such:

class User < ActiveRecord::Base
belongs_to :role

class Role < ActiveRecord::Base
has_many :users

my index action looks like:

render(:json => User.for_data_table(self, %w(email last_name roles.title last_sign_in_at), %w(email first_name last_name roles.title)) do |user|

I'm able to get everything working fine with the exception of being able to search on the title field from the joined roles table. I get "ERROR: missing FROM-clause entry for table "roles"" Am I missing a place where I should be defining the join?

Rails 4 support

Could you please release a version compatible with Rails 4.

Fresh data_table install

Hello,
I Have added 'gem 'data_table'' to my Gemfile, but after server run I recive error:

uninitialized constant Mongoid::Document

I dont use Mongoid. I use default ActiveRecord.

Thanks in advantage for help.

How to use with show action instead of index

Hi,
I am trying to use this gem. I want to display data table for show action instead of index action.
For example,
class Post
has_many :comments
end

class Comment
belongs_to: post
end

//// Post controller
def shows
//// business logic
comments = @post.comments
respond_to do |format|
format.html
format.json do
render(:json => Post.for_data_table(@comments, %w(... ), %w(...)) do |comment|
["<%= link_to(comment.id, comment_path(comment)) %>", .....]
end )
end
end
end

I get NoMethodError (undefined method `for_data_table' for class.

Can you please provide documentation or any suggestion how to use it?
Thanks,

documentation

This looks cool, but hard to tell from the docs, spent 15 minutes, couldn't figure out how to use it.

  • Does it use ajax for data tables?

  • In your example you have:

    render(:json => Provider.for_data_table(self, %w(name fein categories.name county state), %w(name fein)) do |provider|
    ["<%= link_to(provider, provider) %>", provider.fein, provider.category.name, provider.county, provider.state]

what does:
%w(name fein categories.name county state)
vs
%w(name fein)

do? these look like 2 sets of attributes for the same provider..

I assume in my gemfile I need to include:

gem data_table;

I dont use haml, assume I just set the id of the table?

Do I need to include jquery datatables in my asset pipeline? or you do for me?

Dates does not work when using Postgres

Whenever using postgres, search queries fail.

If it uses UPPER(date) it fails because UPPER does not accept timestamps.
If it uses just date like '%2011-05-%' it fails with error: PGError: ERROR: operator does not exist: timestamp without time zone ~~ unknown

Deprecated call in lib/data_table.rb when using Rails 4.1.6

Using data_table v0.4.13 with Rails 4.1.6 results in the warning:

You have required active_support/core_ext/object/to_json. This file will be removed in Rails 4.2. You should require active_support/core_ext/object/json instead.

I believe this is caused by line 3 in the data_table.rb file:

require "active_support/core_ext/object/to_json"

Regards,
Don McClean

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.