I've been looking around for a while now, with little success ... are there any timeframe / estimates on when Rails 3 will be live? There's been lots of hype about it for months, and I'm looking forward to moving over to it, but I don't know quite how to manage my expectations in terms of projected release dates. Anybody know?
No, but this is my question as well. There's plenty of stuff on the net about how great Rails 3 will be, but the last time I checked out edge Rails (around three months ago), it felt pretty far from ready for prime time.
They've done a lot of refactoring, and made a ton of improvements, so I can understand a longer-than-usual development cycle, but all the hype around how great things will be, without seeing a stable release, is a little unsettling.
While this is neat, the redirect and template-rendering generic views aren't the ones I'm really interested in. What I'd want if I were looking at Rails is an equivalent for the content-retrieving generic views (which provide indexes, archives, date-based navigation, etc.), but I don't see anything about them here.
The powerful thing about generic views -- as far as I'm concerned -- is that they're encapsulated generic logic. Things like "show an individual object" or "show objects published in December 2009" or whatever, which crop up over and over in real-world use, and which are best written once and reused over and over again.
I hope I showed that those sorts of things are quite possible using the same basic techniques that I showed for the redirection and rendering generic actions. Thanks for the feedback :)
Well, it may just be that I don't know enough about Rails, but how do you do that sort of thing? For example, what's the equivalent data structure to a QuerySet that you'd pass around as an argument?
One (pretty simple) solution would be to use a block to pull out the object in question:
match "/:id" => object_detail {|params| Poll.find(params[:id]) }
Rails 3, with its ActiveRelation integration, could also support a syntax similar to the QuerySet syntax:
match "/:id" => object_detail(Poll.all)
where Rails would internally take the Relation from Poll.all and do @relation.where(:id => params[:id]). To be honest, while the newly available syntax is nice, lightweight block syntax is pretty nice as well.
This isn't just "Rails can do what Django does" ... it's why it can, and how that could be used to do lots of other cool stuff.