Just A Summary

Piers Cawley Practices Punditry

Initial release of acts_as_resource 18

Posted by Piers Cawley Thu, 25 Jan 2007 12:56:00 GMT

Right. I’ve bundled acts_as_resource up and stuck it on the typosphere SVN server. You can grab it from http://svn.typosphere.org/typo/plugins/acts_as_resource if you’re interested.

It’s currently in what I’d call an all convention, no configuration state – if your resources don’t look pretty similar to the kind of things you get from the resource scaffolding, you’ll probably have some pain, but I expect to rectify that with coming releases. One thing I want/need to do for instance is to allow for ‘relative’ ids in your resource url. For instance, if you’re looking at /albums/10/tracks/982, it’s not the most readable of permalinks… next trick is to allow you to have urls like /albums/because-its-there/tracks/1, ie: the first track on the album ‘Because it’s There’. I’m sort of expecting that you’d do that by doing:

class Album has_many :tracks acts_as_resource :uri_field => :name_dasherized end class Track belongs_to :album acts_as_list acts_as_resource :uri_field => :position, :parent => :album end

However, my first priority is to add some tests (or, more likely,Rspec specifications) so I’ve got some confidence that I’m not breaking things as I go.

Anyhow, go grab the plugin, have a play, let me know what you think.

'acts_as_resource' progress

Posted by Piers Cawley Thu, 25 Jan 2007 09:30:00 GMT

I’m very nearly ready to release acts_as_resource, I just have to pull up and tidy code that’s currently in my working directory’s ApplicationController and we’re laughing. However, I thought you’d like to see what my nested controller looks like.

Tips for data smugglers

Posted by Piers Cawley Thu, 25 Jan 2007 02:25:00 GMT

While I was working on the acts_as_resource plugin trying to fix things up so that the resource finding side of things works neatly, I realised that I needed some way to get at the ordered list of parameter keys that were matched by the routing system.

One way to do it would have been to parse the path again, but that smacked a little too much of repetition, after all, the routing system knows this stuff already, but how to get at it?



Just A Summary