I'm looking for a Rails plugin that facilitates showing lists of objects. Ideally I'd like to pass an ActiveRecord query and get a table that shows a result of this query. The table should be sortable, paginated and searchable (using some kind of filters).
I've already found two that might be ok. The first is DataGrid. It looks fine, but it uses will-paginate and as I adopted kaminari in the project, I'm not sure if such mixing would be a good idea.
FancyGrid looks tempting, but it seems to be not maintained and so I'm not sure, if it's good idea to use it.
Do you know anything more?
There's a railscasts that may be relevant. See here
Fancygrid is currently in the proess of being refactored. Please be patient, there will definitely be a new release.
A new version of FancyGrid has been just released.
You can find all related plugins here:
https://www.ruby-toolbox.com/categories/Table_Builders
So there are several other plugins:
Tabletastic
TableForCollection
Tableasy
Related
I need a Rails plugin that gives you the chance to purely separate HTML and any logic in your views. Views should be classes reading the separate markup and replacing it with dynamic content where needed.
Basically Effigy from github does this.
I am looking for something like Wicket, but on the Rails base.
I can remember seeing a plugin from a Rails enterprise that does this. In my memory, it was better and seemed more mature than Effigy. But I forgot its name. It was something like "luxurious" or "delicious"; does anyone know what I am talking about? The plugin was created in a US Rails enterprise.
Any other alternatives would be much appreciated.
I feel that Effigy is almost OK, but it's hard to find tutorials or people using it properly, so I question its the maturity.
Well, if nothing comes up, I will go ahead with Effigy for now.
All right guys, I think I finally found what I was talking about.
The plugin is called "Erector"
The thing that I like about it, is that views are finally plain ruby objects and you can do everything you can usually do in ruby. I found couple of blogposts:
https://github.com/erector/erector
Why I always liked this idea you can easily see in this blogpost
I want to thank the creators for this.
What's the standard/best option out there for this kind of version control? The main thing I'm looking for is to track what user edited a record.
I've seen these so far and am wondering what your take is:
PaperTrail
ActsAsAudited
VestalVersions
The plugins you mentioned all seem to take the same approach, and seem to be somewhat similar in approach: use a seperate table to store the old versions.
None of them seem to be really rails3-ready (looking at the generators), but PaperTrail reportedly should work with rails3, and has the most recent commit.
You could also look at the ruby-toolbox user-stamping and versioning. There you can see which project has the most "traction", which has the most recent commits. Which sometimes can help to make a choice between similar options.
For stamping user_ids onto rows there is the the userstamp plugin
http://github.com/delynn/userstamp
EDIT:
Based on the requirement mentioned in your comment, I would recommend act_as_audited
http://github.com/collectiveidea/acts_as_audited
We are using it successfully for a very large application.
Peer
I think PaperTrail is what you need to solve this problem.
With PaperTrail you can track and see all changes ,to any model, with user id of who made the changes.
It is currently the best maintained project of the three you linked
HI #viatropos I thought that these two links might prove to be helpful
http://api.rubyonrails.org/classes/ActiveRecord/Observer.html
http://www.robbyonrails.com/articles/2007/04/27/observers-big-and-small
I have a customer that wants to build their own questionnaires. Something like WuFoo (www.wufoo.com) but more secure and contained within the app.
I've looked at Smerf (http://github.com/springbok/smerf) which provides the yaml-to-form conversion, but I'd like something the user can use to create their own forms.
I would look at using active_scaffold. The main version has not been updated for Rails 3, but a fork at the location below has. I think it would work well for your purpose, you just need a way to grab the data and feed it in. Here is a demo of what it looks like when it is running:
https://github.com/vhochstein/active_scaffold
Here is a demo at the top of the page:
http://demo.activescaffold.com/roles
You could always embed Google Forms. Might be easier than reinventing the wheel. Unless you have some specific use case this doesn't cover?
If you are not adverse to going the Javascript route the then you might consider one of the many framework plugins like the JQuery Form Builder. From a usability perspective it seems to me that any good solution is going to involve some Javascript. There should be no reason why this approach wouldn't integrate well into a Rails backend
You might want to check out this one. Dynamic Forms
I too am looking for something very similar. What solution did you come up with?
This seems like a classic rails situation: I want to have a my index action display a sortable table of the items. I've looked at (and hacked at) some plugins, notably thoughbot's sortable_table and Michael Kovacs's sortable (the latter I have forked and improved). However, now I'm finding that sortable is somewhat incompatible with inherited_resources and I'm getting frustrated with fixing code that's not really being maintained.
And yet ... everyone must hit this need in their app, right?
So, what's the best solution? Does everyone roll their own? Is there a plugin I haven't heard of yet? Do people not bother with sortable tables? Is there some javascript/ajaxy thing I should be using instead? I'd love to find a better solution.
Update: should note that my database table is too big to load all of the rows, that would absolutely kill performance.
I've been using the jQuery DataTables plugin recently and have really been loving it. Small downside is that it requires you to load all of your row at once since it relies on Javascript, but it can then do some pretty fast and fancy pagination, filtering, and lots of other cool things.
I always hated sorting tables in Rails, this made it a lot easier.
Edit: As stated in my comments below, check out http://datatables.net/examples/data_sources/server_side.html if you want to do server side pagination/sorting. Fairly easy and this works great with a PHP project I'm currently working on as well :-)
I use wice-grid, which is not only sortable, but can also be filtered, paginated, customised. I really like it ;)
I like the YUI Data table. Articles and Support community
It can do client-side or server-side sorting, depending on your preference and data set size.
Can also be used for editing the data.
There are rails plugins for use with YUI Data table -- Google for "yui datatable rails" -- but I haven't tried any of them yet.
it is not forcely needed to use a plugin
see http://railscasts.com/episodes/228-sortable-table-columns
I've been looking in some of the latest Grails books and many open source projects for samples and best practices for adding search/filter functionality to scaffolded list.gsp:s, eg making it work with pagination and sorting etc. This may be a simple task, but being a Grails newcomer it would be of great benefit in having some thorough samples to look at.
The closest thing I've found is the FilterPane plugin, but that is a very general solution - so the code may be unnecessarily complex to retrofit to a more custom search/filter. Does anyone have or has anyone seen good sample code for this? I'm thinking it's a very common requirement so it must be out there...
Check out http://jira.codehaus.org/browse/GRAILS-5225, it's a set of alternate scaffolding templates. They support filtering and searching (if you add searching plugin). The scaffolding templates take a bit to get working, but they will show you how to do things.
Another plugin to check out is the Criteria Plugin.
There is also UberScaffoling Plugin, which allows you to inject code into scaffolded templates, of which I am the author, but I haven't posted updated in a while and I think what's on there may have a bunch of bugs right now. Let me know if you are interested in it - I could email you the latest version (need to find the time to post on grails plugin repo).
Check this blog post - https://blog.uni-koeln.de/rrzk-knowhow/2012/03/14/add-filter-pane-to-your-customized-scaffolded-templates-for-list-pages/
Only downside is need some styling re-work for the filterpane to look neat.
filterpane:2.0.1.1
Grails 2.0.4