{ height: 1%; } - Ruby on Rails and User Interface Design

CSS, UI Design, Ruby on Rails and cheese ... lots of cheese

AjaxScaffold 3.1.2 released

Posted by Richard White Thu, 27 Apr 2006 14:54:00 GMT

AjaxScaffold has been deprecated in favor of ActiveScaffold

This release mainly addresses issues people with non-standard (by Rails definition) table names.

  • Fixed default sort to work with non-standard (overridden) table names and primary keys.
  • Fixed bug that was allowing models to be generated in the plural form and in subdirectories.
  • Fixed edit/delete links so that they work with non-standard primary keys (ie not id).
  • Removed test methods from the controller functional test since they were all outdated and broken anyways.
  • Changed controller actions to explicitly call RJS templates so there aren’t any errors with conflicting RHTML templates. This was a common problem people had when upgrading from 2.0 or generating an ajax_scaffold over top of a

    basic scaffold. If there was new.rjs and new.rhtml the RHTML would win out every time. I fixed this by changing return if request.xhr? to return render :action => ‘new.rjs’ if request.xhr?.

    Thanks to Jamis Buck for his prompt email reply on this issue that allowed me to sneak the fix into this release.

  • Changed the helper methods for column header and element row id’s to be more properly namespaced. The current way they were done allowed for the possibility of the top level id for the scaffold (scaffold_id-content) being repeated on a column header if that column had the name ‘content’. A very unfortunate thing would result in that case:

I’d also like welcome Jim Morris as the newest member of the AjaxScaffoldGenerator development team (actually the only other member outside of myself). If you’ve been on the forums at all I’m sure you’ve seen him around helping many of you out. Jim will be helping with some of the upcoming improvements/tweaks to the way scaffold_columns work.

Also, I should mention that I’ve made the Backpack page which outlines upcoming scaffold development public so feel free to take a look to see where we are going and make any suggestions.

I’d also like to apologize to those of you that have emailed me or posted questions on the forum lately. I’ve been very busy this week in preparation for my trip to the west coast for Startup School 2006. I’ll try to get back to everyone as soon as possible, in the meantime thanks to the rest of the community for filling in and helping out the newbies on the forum. Thanks.

Comments

  1. Will Merydith said about 1 hour later:

    Is there a start up guide for this gem? I installed it but really didn’t know where to go from there. I’m familar with RoR, and have a site I wanted to integrate this gem into for my admin pages.

    Thanks.

  2. Richard White said about 3 hours later:

    Will: If you go to www.ajaxscaffold.com you’ll see a documentation page. Or you can just click on ‘ajaxscaffold’ category on the right side of this blog. You want to read the 2.0, 3.0 and 3.1 release notes and you should be set.

  3. Kaveh said about 15 hours later:

    Richard: Speaking of release notes don’t forget to add this one to the Documentation page at ajaxscaffold.com :-)

  4. Kaveh said 1 day later:

    The change to the controller actions to explicitly call the rjs templates effects the instructions for the has_many and belongs_to demo indicated in the release notes for 3.1.0

  5. John Cabrer said 1 day later:

    Hi Richard! I just sent you some weekend fun money. Enjoy it, and thanks for the hard work.

  6. Richard White said 1 day later:

    Kaveh: I’ll put that on my todo list for when I get home, its a bit hectic out here on the west coast bouncing from wifi to wifi :)

  7. Richard White said 1 day later:

    John: Thanks so much. It was pleasant surprise to find your generous gift in my inbox when I finally found a wifi out here :)

  8. Justin said 2 days later:

    If I use a new scaffold page to create, say, a Product, and then immediately after click the Edit button to edit the newly-created product, I get the following error:

    "Couldn't find Company with ID=0"

    Is this a known issue? I’ve been able to reproduce this error with every single version of AjaxScaffold I’ve used. Am I the only one?

  9. Kaveh said 3 days later:

    Justin: have you tried generating scaffolds on a fresh/new rails application? you should probably move the issue over to the forums at http://groups.google.com/group/ajaxscaffold/

  10. josh said 4 days later:

    I still have problems using “non-standard” table names. I’d be happy to post the error message or help debug in any way. Just email me about it. Basically it’s running this query: SELECT * FROM (SELECT TOP 22 * FROM (SELECT TOP 22 * FROM fsk_allocations ORDER BY fsk_allocations.id asc ) AS tmp1 ORDER BY fsk_allocations.id DESC) AS tmp2 ORDER BY fsk_allocations.id asc. Not only is that a double nest, but it fails because the tablename after the alias is tmp1, not fsk_allocations. This is using ms sql database.

  11. Richard White said 4 days later:

    Josh: Looks like this bug. Feel free to add any other debug info you have there.

  12. Justin said 5 days later:

    Kaveh: I’ve actually only tried this on fresh Rails apps, and I’ve been able to reproduce it every single time. I would bring this issue to the Google group if it didn’t require signing up to be a member to post, but it does. ;)

  13. Richard White said 5 days later:

    Justin: I’m sure Google already has your entire life story on file so you probably don’t have much to lose by signing up :) Feel free to post it on the bugs site (though that requires signup as well). Or you can just email me (though I’d prefer the former options).

  14. Richard White said 5 days later:

    Justin: Actually I just went ahead and made the forum not require signup to post.

  15. oystein@quadnetwork.com said 12 days later:

    I have a some fields in my database that is of type time. Ajax scaffold ignored these fields at generation time. Is there something I should know about the time fields? Cheers Oystein

  16. Geoff said 12 days later:

    For the render :action => ‘action.rjs’ if request.xhr? thing, could you not possibly use the respond_to method instead. Admittedly the solution you currently have may be(probably is) better for this project. But its something to be aware of (I just learnt of its existence the other day) http://api.rubyonrails.org/classes/ActionController/MimeResponds/InstanceMethods.html#M000062

  17. Richard White said 13 days later:

    oystein: I haven’t ever tested it out with a time field. What was the name of the field and what was the DB vendor?

  18. Richard White said 13 days later:

    Geoff: Yeah I considered changing it to responds_to since I suppose that’s the new way of doing things but to be honest I am not a fan. My main gripe is that it misrepresents itself. responds_to.js simply means that is an XHR request. Often XHR requests should just return HTML, which would lead me to think that it should responds_to.html, but this is not the case. Because of that I’m happy to stick with request.xhr? for now.

Trackbacks

Use the following link to trackback from your own site:
http://www.height1percent.com/articles/trackback/39

(leave url/email »)

   Comment Markup Help Preview comment