Docs are moving to GitHub wiki

In an effort to better open up the ActiveScaffold infrastructure to the community, we’re migrating online documentation over to the GitHub wiki. Please help out! I was able to migrate the documentation pages, but everything from the user wiki should also be moved over to the GitHub wiki. Eventually we will be taking down some of the activescaffold.com pages to better promote the community-editable versions.

Again, the goal is to make it easier for the community to participate in the project at all levels. This should help alleviate any bottlenecks due to busy core devs. If you have ideas or concerns, please direct them to the mailing list in the next month so that the community can participate in the discussion.

ActiveScaffold Sponsorships

I’ve been thinking back to the months leading up to ActiveScaffold 1.0 and about how much the project really owes to those generous sponsors who encouraged a few devs to contribute to the open source community. That was great!

Could it happen again? I think so! We still maintain ActiveScaffold as we have time (props go to Tim for the push to support Rails 2.1), but I think the project could really benefit from another sprint of activity. There are a few things that would help the project to remain stable and would ease community contributions, such as versioned documentation (rdocs!) and a full test suite. But that’s my bias—what do you think it needs next?

If you like the idea of an ActiveScaffold code sprint and would consider being a sponsor (large or small!) would you please fill out a quick survey?

Thanks!

Update: Thanks to everyone who took the poll – it doesn’t appear that sponsorships are the way to go at the moment.

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

ActiveScaffold Saddles up with Git

With so much fun happening in git land, ActiveScaffold has officially cut it’s ties from Subversion and moved completely over to Git. All git related repositories can be found at the following URL:

http://github.com/activescaffold

Why?

The advantages of using Git are too numerous to identify in a short article, but among them are the following:

- Contributing will be easier for all: you can create your own fork of ActiveScaffold to add a feature or fix a bug. Then submitting your patch is as easy as sending a pull request.

- You don’t have to wait for ActiveScaffold core to accept your changes before updating to a newer version. With git, you can pull updates from core and merge them in with your changes.

- Git is super, super fast. I mean REALLY FAST. It’s incredibly space / bandwidth efficent, too.

- Branching is painless in git. Merging your branches is also painless.

- The concept of a “core team” is diluted. ActiveScaffold core doesn’t have to agree with your awesome save-the-world do-everything feature. Just fork and then build it. If it rocks, other people can use your version.

So Come Hop On!

So, if you haven’t already, come join us on the git bandwagon. There are plenty of easy ways to install git now – packages exist for OS X, Windows, and many distros of Linux.

Yeehaa!

just released: 1.1.1

This patch version is just a quick fix for some rendering issues with Rails 1.2.x.

Now available from:

just released: 1.1.0

We’ve tagged and packaged the newest official ActiveScaffold release, version 1.1. This version comes packed with a host of features and fixes from version 1.0.1. And like many other versions in the open source world, this is mostly just an excuse to tell you that you should upgrade.

A couple quick notes for users of different versions of Rails:
  • Rails 1.2.x: This will probably be the last version of ActiveScaffold to support the Rails 1.2 branch. Trunk may break backwards compatibility any time now.
  • Rails 2.0.1: Please upgrade to 2.0.2, otherwise you’ll have trouble with subform field overrides (see Rails changeset 8385).
Now available from:

1.1.0 Release Candidate 1

The first release candidate for ActiveScaffold v1.1 has been officially tagged. Why should you bother updating? Bigger version numbers are better, of course! One of the features in this release, though, is a a brand spanking new changelog. Peruse that to get some idea of what we’ve been up to since 1.0. I’ll give you a hint: a little bit of everything, including file uploads, improved customization options, and even a touch of speed and security.

We’ve been holding back on releasing v1.1 largely because of how much we could possibly still do. It’s time for us to admit that we (like you?) will probably never finish our lists. Despite the problems and missing killer features we still know about, this version represents a significant upgrade to v1.0, and we want to give people a chance to update without chasing the trunk.

So what’s our goal with this release candidate? We want this to be a smooth upgrade (with extra features and fewer bugs) from v1.0, so we’d really appreciate if you could find some time to try out 1.1 RC1 and file bug reports for any exceptions, regressions, or backwards compatibility problems you encounter.

Now available from:

Need Rails Development?

Need Rails development? Web design? Rich and I are taking on new clients. We have experience with frontend and user interface design, planning and building production Rails applications, and have built a variety of plugins to extend the Rails stack. Let us know about your project and how we can help.

DeveloperWorks article

Mike Perham at IBM has written an excellent tutorial/introduction to ActiveScaffold for DeveloperWorks. Have a read and let him know if you like it.

How to Approach Active Scaffold (Use Cases & Benefits)

Ok, so there’s this plugin called ActiveScaffold, right? And you’ve installed it, and it looks cool, but you’re trying to figure out where to use it and how it can benefit you, and you’re wondering where to start reading in the documentation. Well look no further – this is our attempt to help provide some perspective.

Use Cases

The word “scaffold” has something of a bad rep in the Rails community. On the one hand, you’ve got people telling you that scaffolds are just to “get you started” and that they should be replaced by something custom as soon as you have time. But in the back of your mind something ticklish is trying to tell you that scaffolds could be better, could do more, could be smarter. But these other people are telling you that no, scaffolds are not better or smarter and don’t have more features because you really really need to customize things yourself.

We agree. With all of you. The built-in Rails scaffolds are meant to be replaced. But something scaffold-like could solve a common pattern in a lot of applications, supposing that something were smarter and cooler with more features. And that’s where ActiveScaffold enters the picture.

Ok, so ActiveScaffold is a solution to a common pattern. Where does that pattern usually show up in applications? How can (should) ActiveScaffold be used?

Prototyping

This is what the built-in Rails’ scaffold is good for. And ActiveScaffold is even better, because its intelligence and configuration and customization options let your prototype be even better. But it’s all so easy that you shouldn’t feel guilty throwing away the prototype and doing your own thing. In the end we really want to promote the idea that every application has different needs, and if ActiveScaffold doesn’t fit those needs you should replace (or configure/modify) it.

Admin Interfaces

Your web application is cool because of how it’s been customized and designed for end-user experience. But you usually don’t need to put as much effort into backend stuff. ActiveScaffold is perfect for this, because it’s so easy to whip together some scaffolds and create a backend. Then you can spend your time working on the things that increase your user base and conversion rates.

Granted, ActiveScaffold’s not going to take care of all your backend needs. Sometimes you really ought to pay attention to the backend and customize it for a better workflow. But the backend is often the last thing you want to invest a lot of time into, and ActiveScaffold lets you build a very functional and usable backend … for free.

Embedded, Widget-Style

Ok, so you’ve maybe got ActiveScaffold running your admin interfaces. Or maybe not. But you’re working on the website design and you come to a page where what you really really need is a miniature ActiveScaffold displaying a subset of data in some table. You’re in luck. You can “embed” ActiveScaffold like a widget in your page while at the same time constraining it to a certain context.

For example, let’s say you’re creating a Major League Baseball website, and you’ve got a page for each team. You’ve also got a table in your database with all the players, and what you really want to do is create a team roster. You could do this with ActiveScaffold, and you could make it pretty slick. You could just add a <%= render :active_scaffold => 'players', :constraints => {:team_id => 5} -%> in your page and voila! Instant roster! Ok, but you want to customize it, because you’ve got pictures of all the players. No problem, just override your “picture” field so instead of displaying a useless file name it displays a thumbnail. Ok, but now you want to disable Create and Update because really, end-users shouldn’t be editing the list. Well that’s easy, just use one of the supported authorization methods to disable Create and Update for everyone except logged-in admins.

Data-Heavy Applications

Let’s face it: sometimes your application just needs a way to manage data, pure and simple. It’s not the entirety of your application, but you need it. This can be a situation similar to one described for embedding, except there’s really not much else to put on the controller except ActiveScaffold. You just want people to log-in and update some records in a database table. Or you have a commercial website selling a variety of thingamabobs, and you want people to browse and pick a thingamabob for their shopping cart. You get the idea. Go for it! Take advantage of all the stuff ActiveScaffold gives you for free, and tweak it for your situation at hand.

Generator Benefits, Without the Mess

Generators have their upsides and their downsides. And wow, those downsides can really weigh you down. Have you ever tried to update generated code? You don’t, really. The idea behind generators is that they help to get you started, and that you really should own everything they spit out. And that’s cool, because you can tweak and customize and basically get a jump-start on developing your final solution. But in the case of a plugin like ActiveScaffold, you want all the new features we keep adding. You want the patches for the bugs we’ve found. And you don’t want to own the code, you want us to own it. And yet … and yet you still need to tweak things, and go beyond the built-in ActiveScaffold behavior to do your own thing.

Perfect. We want you to go beyond the built-in behavior, too. ActiveScaffold gives you all the customizability of generators without all the drawbacks of maintenance. We call them “overrides”. What can you override? Well this is Ruby, so you can really override anything you want, but that’s not the point here.

Field Overrides

You can override how stuff gets displayed in the List. Maybe you want to display dates in a different format. Maybe you want to take that file column and display a thumbnail of the actual image, instead of the boring filename. Maybe you want to add some color to the display, highlighting a number in red if it’s below zero. Or maybe you want to add inline editing so people don’t always have to open up a form to change stuff around.

Field overrides are the way. You can define a method with a conventional name and place it in your helper file, and ActiveScaffold will pick it up and use it to replace its default field rendering behavior.

Form Overrides

Ok, so field overrides work for List, but what if you want to customize Create or Update? What if you want to use a <textarea> of a specific size, or you want to create a special <select> box that uses JavaScript to dynamically change the options of some other <select> box.

Same procedure. You can define a helper method with a conventional name, and ActiveScaffold will depend on it to render the form widget.

Template Overrides

Ok, yeah, but you’re to the point where you really just need to customize an entire section of the UI. Changing a field here and a form element there just isn’t going to do it. You need a feature we don’t have, and you need it to work a very special way for your application. That’s fine with us, so go ahead and create a template to replace one of ours. ActiveScaffold will give it priority, and you’ll be on your way to a completely custom form layout.

(Really, the first time you create a template override will probably be for _show.rhtml. Our Show view really kinda sucks, because a generic plugin really can’t do much better. You really should customize it.)

Action Hooks

The next thing you realize is that you don’t need to change something that’s already there, you need to add a whole new action. You need a link on each row that activates a planetary defense system. You need a link on the page that makes it snow in Mexico. Well, um, ok. I guess. You can go ahead and use the same system ActiveScaffold uses to tie all of its actions into the List. You can add your own actions, and hook into your own custom controller logic. Go for it.

Navigating Documentation

But where can you find out about all these cool features? What is a “method with a conventional name”, and which helper file do you put the method in? And why didn’t we go into more detail on this stuff or at least make links everywhere like in Wikipedia?

Meh, maybe we got lazy with the links, but the information you need is right here on the website. The question is how to find it. How is the documentation organized, and how can you find what you need? And what if the docs don’t answer your question?

The first thing to find is the search box. Use it. Embrace it. If the navigational structure doesn’t make sense to you, just bypass it and find what you need with a search. The next thing you want to do is read some of the tutorials. These are topical articles that explain how to accomplish common tasks. Check out the FAQ for some other mini-tutorials.

Or go ahead and browse the actual documentation. This is a more technical segment of documentation, mostly about the API of the different pieces of ActiveScaffold. So to find options for configuring the List action, check out the API: List page. We’ve tried to sprinkle examples throughout the API, but the emphasis there is more on completeness than friendliness (which is what tutorials are for).

And finally, we’ve got an entire page on how to get help. Check it out. Join the forums, get involved. We’d love to have you!

The first patch: 1.0.1

We released a patch today for ActiveScaffold. Version 1.0.1 fixes some annoyances and makes a change to the security layer.

Changes:
  • The DHTML history now makes GET requests, which makes it RESTful
  • The ‘show’ view has been tweaked for IE
  • The security layer was checking the wrong CRUD types in some cases
  • The ‘Cancel’ links on the Create and Update forms now work properly even after a failed validation

Also, we’ve updated the demo with a security scenario. You can visit the secured_records controller (yeah, a rather bland name) to see the security layer in action. There should be a link on the page that will toggle your login status with a demo user.

ActiveScaffold @ RailsConf

Lance and myself will be representing the ActiveScaffold team in Portland at RailsConf which is just a couple of days away. We of course have some goals for the conference:

  • Learn something new
  • Meet cool people
  • Spread the word about ActiveScaffold
  • Drink some good Portland area microbrews
  • Between us, attend all 13 sessions on Rails & EC2 :)

The last one might be tough, but the others are definitely doable.

There will be a BoF (Birds of Feather) session Saturday night on Automated CRUD Plugins – scaffolding and beyond that we hope will attract users and developers of ActiveScaffold, Streamlined, AutoAdmin, Hobo and Scaffolding Extensions to discuss our individual problems and solution sets. I hope you’ll join us.

We’re also planning to get involved with RejectConf and maybe do a quick presentation there.

If you’d just like to stalk Lance and I or would be willing to help on our goal of total EC2 coverage we’ve posted our individual conference schedules: Lance and Rich.

ActiveScaffold goes Gold: 1.0 Released!

ActiveScaffold 1.0 is now available, download links are in the upper right, just in time for RailsConf (more on this later). Big thanks to the whole core team: Lance, Ed, Scott and Tim for their hard work that got us here.

Rather than dwell on what 1.0 is, which is well documented, I’m going to focus on what’s next for ActiveScaffold (see development roadmap):

Spinning off independent plugins

There’s a lot of code in ActiveScaffold that could be generally useful to the Rails community, not just to ActiveScaffold. We’re keeping an eye out for parts of ActiveScaffold that could be spun off as separate plugins that people can incorporate independently into their Rails projects. If you see anything that fits the bill, let us know.

Improving form components

Our first major goal will be to turn our attention inward and focus on improving form usability. We’ll be focusing initially on better support for file uploads and replacing those horrid date/time pickers that Rails gives you with something more… friendly (like DHTML Calendar for instance).

Adding semantic goodness

But there’s only so much improvement we can make to the forms initially because we lack any sort of semantic definition of what individual model attributes are. How do we know that user.home_number is actually a phone number? Or that user.email is an email address?

The SemanticAttributes plugin, to be released separately from ActiveScaffold, will allow you do define semantic meaning for your attributes in your models:

class User < ActiveRecord::Base
  is_email :email
  is_telephone :home_phone
end

What can we do with that information? For one, we can define sensible Rails validation checks for you. Secondly, when ActiveScaffold detects the use of SemanticAttributes, we will be able to give you even finer grained form and list widget options: a 3 field telephone input, special search options for emails, etc.

We’re really excited about the idea that we can define meaning rather than function (Rails validations) and reuse that knowledge all over your application keeping things very DRY.

RC2 Released

One month and 270 revisions after RC1 we’re finally ready to release RC2. What does that mean exactly? For one, it means we were using the term ‘release candidate’ pretty liberally before, but we really mean it this time. Most importantly it means that ActiveScaffold is feature complete and the API is stable for 1.0.

What’s left before 1.0? Just clearing out our existing bugs and waiting to what ones are created by this release itself. But the bugs left are largely edge cases and not impairing core functionality and for this reason we’re officially deprecating AjaxScaffold and redirecting everyone to ActiveScaffold. We feel ActiveScaffold is ready for prime time.

Before we get ahead of ourselves there are a few changes to API that will break some of your code from RC1

Form and Field Override Methods

The arguments on field and form override methods have changed:

Field Overrides

#{column_name}_column(value, record) is now #{column_name}_column(record)

Form Overrides

#{column_name}_form_column(record) is now #{column_name}_form_column(record, input_name)

See the docs on Field Overrides and Form Overrides for more information

Security API

There have been a number of changes to how security works, your best bet is to check out the updated security docs

Subversion Changes

We’re deleting the ‘current’ svn tag so make sure you’re using the ‘activescaffold’ tag (If you’ve installed the plugin using script/plugin as prescribed in Getting Started then you’re fine).

Thanks and enjoy

Update 4/16/2007 10am PST: A couple of changes didn’t make it into the release initially, so if you downloaded or checked out RC2 before now please re-download or svn update.

Localization Policy

After some deliberation, we have decided to simplify ActiveScaffold’s position on localization. When we first started to embrace localization, we thought it was as simple as providing some language files and having a setting to determine the locale. After feedback from devs using ActiveScaffold, and after more personal experience of our own, we have decided to simplify.

From now on, what we will try and do is make ActiveScaffold cooperate as best it can with your needs by providing a hook into all the strings for which ActiveScaffold is responsible. What we will not do is actually attempt any localization. Here’s a break-down of what this means:

What we will try and do:
  • Use a unique overridable method pervasively. This method will be Object#as_(). There are still some places we’ve missed, and we’ll try and fill these in soon.
  • Provide the Object#as_() method with everything it needs to inform your translation. At minimum you should have a simple and easily-translated string. Due to the configurable nature of ActiveScaffold, we won’t be able to tell you its plurality (we generally don’t even know).
  • Make sure that any call to Object#as_() happens after the session is known, so that you have the chance to know what the target locale should be.
What you must do:
  • Build and maintain the translation table.
  • Override the Object#as_() method to interface with your localization system.
  • Hook into Rails internals to harvest and translate its built-in strings that ActiveScaffold happens to use (like True/False, error_messages_for, months in the datetime selectors, etc.)
  • Pick the proper locale for your user

Now this policy still leaves open the opportunity for the ActiveScaffold community to share the work of localization. It is our hope that people will make available translation tables using an add-on plugin, wiki pages, or whatever you all find convenient.

Our goal with this policy is to get out of your way and let you do localization as you see fit. With ActiveScaffold we are solving the problems of a basic data presentation pattern, and that’s where we want to keep our focus. But we realize that you have international needs, and we want to at least provide you with a means to fill those needs.

Feedback is welcome! If you find a situation where we are not fulfilling our responsibilities, let us know in the Google group or the issue tracker.