25
Easy Restful Rails Screencast
by AkitaOnRails on Jan.25.2008 at 08:26pm
Update 28/01: Seems like myself and James Golick were in sync here :-) We both did screencasts at the same time. He just recorded one for his other great plugin “attribute_fu” and I did it for “resource_controller”. He posted both at his blog. Check it out.
This is my second try to make a useful screencast. I think my last one The First Rails 2.0 Screencast was reasonably good but far from good enough. I thank everybody that has seen it and helped making it one of the most successful pieces I’ve ever made.
I’ve been wanting to explore the Restful Rails concepts in a screencast. First and foremost, I highly recommend Geoffrey Grosenbach’s Peepcode screencast as one of the most comprehensive and easy to understand out there. My screencast is not nearly at the same level of quality or depth. But on the other hand I didn’t want to reinvent the wheel.
Watch the Video
- Vimeo (Stream|Download)
- Veoh (Stream Preview|Download)
- RapidShare (High-Quality, 30Mb in RAR compression)
- through UFRJ (High-Quality, 30Mb Download|many thanks to Marcos Tapajós and the University of Rio de Janeiro)
Explanation
So, the idea came when I saw James Golick’s excelent resource_controller plugin. It does what I always thought should be part of Rails itself: it made Restful Controller as easy to use and understand as ActiveRecord originally does for Models and the database.
This screencast is a quick rendition to this plugin and how to use to leverage the power of Restful controller in your applications. This is one of those great ideas that – who knows – could find its place in the Rails Core one day, the same way Sexy Migrations did.
The concept is that now that we treat a controller’s action in a standardized way (through the abstraction of HTTP verbs) it could perfectly be refactored away from the day-to-day development. So, instead of scaffold creating a bunch of repeated code in every controller, why not have a bare-bone controller, totally empty, to start with?
Another clever idea was to create dynamic helpers for named routes in the views. That way you can move your views around, and even reuse them in different sections without ever copying & pasting several different named routes between them. This is particularly useful for polymorphic controllers and namespaced routes as I show in this video.
At the very end of the video I do a quick summary of what Restful Rails provides you in terms of routes organization, that could be helpful to some.
I am currently releasing this video through Vimeo, Veoh and RapidShare. But I don’t know if this is the best way to do it. Unfortunately my blog doesn’t have the bandwidth necessary to host a 70Mb download (and a 100Mb download on the portuguese version). So if anyone has a better idea on where I could host it (and where everybody else can see it), I would be very help to upload there.
Hope you enjoy it!
Easy Restful Rails – fixed from akitaonrails on Vimeo.
Disclaimer: this video is long, around 50 min long. I first recorded it, live, in english and I tried to do voice over it in portuguese. But it was so difficult that I decided to record again another version in portuguese. This second video ended up being having a different concept and I explain Restful Rails in a bit more detail because the Brazilian audience can’t understand english well enough to learn through Peepcode. So, if you can understand portuguese, you will want to check it out as well.








Hey Fabio, have you considered using Vimeo for your videos? Google Video really reduces the quality to the point where the source code is unreadable. But vimeo looks pretty nice. If it won’t let you upload long segments, you could break up your video.
Another option would be to use Dreamhost, which gives you insane amounts of bandwidth for your videos.
Thanks Fabio – looks great. Here is the correct plugin location:
Edge/Rails 2.0 Compatible Install it: svn export http://svn.jamesgolick.com/resource_controller/tags/edge_compatible/stable vendor/plugins/resource_controller
thanks again!
Awesome! And it’s helpful. But can i download it from somewhere? It lags a lot while i’m watching it online. Thanks.
@John, isn’t the download links above working? like the one from rapidshare?
Oh, I’m totally blind and silly. Sorry for misleading other guys. And Thanks again.
Hey guys, I’ve just seen Railscast #92 make_resourceful .. so, the question is ..
resource_controller OR make_resourceful ??
Thanks for any light !
@joe: good question. Both are good. make_resourceful came first, from Hampton Caitlin. James Golick used to contribute to this plugin.
resource_controller is, therefore, inspired by make_resourceful but taking out some things that James didn’t think was nice, like having the whole thing inside a block in the controller.
Another BIG difference is the way resource_controller adds view helpers that makes the views completely independent of nesting depth. You can literally reuse the same views without never worrying about your links using the correct named routes helpers.
Great, great screencast, learned a lot!, thanks Akita for this one…
Hi Fabio
If possible can you upload the source code for this
Thanks for your efforts
Thanks so much for the great tutorial! Given that resource_controller standardized controllers, I have a question about how you would solve this problem in a RESTful way using resource_controller:
Thanks.. but i got the video in .mov format but is impossible play this in linux, how i can get this video in .avi or an other format
Hi fabio,
would it be possible to make the screen cast into an on-line guide like you did with the first-rails-tutorial?
I’ve followed the directions exactly, however, when I create 2 posts for example,
and go to:
/posts/2/comments/
all the comments show, even from post 1.
What could be the problem?
Why don’t you publish it on a bittorent tracker? After all, that’s what the protocol if made for :)
Gonna get the vid through the forth link :)
P.S.: If you want, i can provide a mirror for the one version in my web space provided by the university. Drop me a line at nikosd at uop . gr
Great work, this was very informative and useful.