ActiveScaffold Sortable official release, with Screencast

I recently updated the ActiveScaffold sortable plugin and resolved a handful of issues. While I was at it, I decided to create a screencast to show off ActiveScaffold and how easy it is to setup.

Clarification

The video shows my old github copies of the repositories. The urls to get the repositories are as follows:

ActiveScaffold

ActiveScaffold Sortable

  1. ActiveScaffold don’t work with last version of Rails !!!

  2. It doesn’t seem to work properly with Firefox 3 either.

  3. I am testing the Active Scaffold sortable and found a few things that makes it unstable ( or maybe it’s me that I am not using properly!) 1- I create a sortable record but creates it with the position null. 2- when you delete a sortable record, is not updated the whole list of sortable records

  4. I started a new Rails project (2.0.2) and I installed the specific version of Active Scaffold linked from this blog post, and the specific version of Active Scaffold Sortable in this post. It doesn’t work.

    It properly does the drag-and-drop and then updates the position columns, but then you get an RJS error. The error, in both Firefox and Safari, is “ActiveScaffold is not defined”. The error happens on a line that looks like this:

    actions = new ActiveScaffold.Actions.Record(

    I’m using a generic layout for testing that’s copied from the Active Scaffold documentation:

    <html> <head> <meta /> <title>Generic ActiveScaffold Layout</title> <%= javascript_include_tag :defaults %> <%= active_scaffold_includes %> </head> <body>

    Just wanted to let you know that it isn’t working. I’m just tinkering and it’s no big deal for me that this doesn’t work yet. I’m excited about getting it working some day since it’s such a cool feature.

  5. Okay I’m sorry, I said that I was using an un-modified Active Scaffold 1.1.1 release in the above comment, but I did make one change. I hacked active_scaffold.js to fix the Safari 3.1.1 incompatibility and I screwed it up. I’m tinkering with it and this plugin works great so far. I’m about to play with sorting nested scaffolds and stuff like that.

  6. Any Plans for 2.1 compatible release? I noticed a couple of folks clamoring for it over on the AS google group. It looks like there is a unofficial patched version (see link below), but there have been some problems with it (including: not loading partial overrides)

    Let us know!

    http://github.com/jfernandez/activescaffold/tree/master

  7. I just checked out the 2.1 branch from GIT and it works fine with my simple model, Rails 2.1 and Firefox 3!

  8. @Boler,

    Partial overrides aren’t working in the 2.1 branch. :(

    -Mario

  9. Yes, rails 2.1 support is in the works, and FF3 fixes as well. Several patches have been submitted, but there we are still finding issues and fixing them as time allows.

    That said, there is a mostly functional branch called “rails-2.1”. This branch will be the next release of active scaffold. Fixes non-specific to rails 2.1 are being backported to the master branch, meanwhile, such as the FF3 issues (which has now been officially released. The FF3 release candidates are not supported).

    Thanks,

    Tim

  10. I’m ecstatic!!

    I just setup ActiveScaffold Sortable in about 5 minutes tops!!!

    It works like a charm. Of course, I’m still on Rails 2.0.2, since it seems the current AS is not stable with Rails 2.1 All in all, this is really really nice. Before seeing this, I was going to write something like that with JQuery or maybe RJS. Looking forward to getting a stable release of AS that works with Rails 2.1

  11. Thanks for the great work and a useful addition to active_scaffold. A couple of questions:

    1. How to make the ordering confined w.r.t. specific user? I have a model with columns like : user_id, task, position. If I have 3 tasks for user with user_id=1, then for the second user, the position field start with 3, and continues with 4, 5 and such. How to customize it so that the position update only happens to the record with the same user_id?

    2. As mentioned above, when created, the position field has null. This problem is hidden once a drag-and-drop happens since the code updates all the position field. This particularly is a problem for user who does not use drag-and-drop reordering. In my code, I had to change the before_create_save to make it avoid this.

    Looking forward to the answer, especially #1.

  12. OK. I figured out the problem (regarding keep ordering values specific to individual users). This is a bug I introduced when I was fixing the problem #2 mentioned above.

    In before_create_save:

    wrong code:

    record.position = Task.count

    Right code: record.position = Task.find(:all, condisions => [‘user_id = ?”, session[:user_id]).length

    Sorry for the confusion. It seems to be working as I want it.

Sorry, comments are closed for this article.