« December 2006 | Main | February 2007 »

REST presentation at Silicon Valley RoR

Jan 18 by Andre in Ruby on Rails » , Speaking / writing »

I presented on RESTful routing last night at the Silicon Valley Rails group. I stepped through some code showing how to use scaffold_resource, set up nested resources using REST, use the new named routes, and use responds_to to return information in different formats (HTML/XML/JS/JSON). I also talked about the motivations for embracing RESTful design.

The slides to this and other presentations I've given are here.

Thanks to everyone who came and listened and participated in the REST discussion!

to_param still works with RESTful routes!

Jan 16 by Andre in Ruby on Rails »
Just a friendly reminder, the to_param trick still works with RESTful routes. This will still give your Post class a nice "ID + title" URL:
class Post < ActiveRecord::Base
  has_many :comments
 
  def to_param
    "#{id}-#{title.gsub(/[^a-z0-9]+/i, '-')}"
  end
end

Nested CRUD resources in Rails 1.2

Jan 10 by Andre in Ruby on Rails »
The CRUD methodology in Rails 1.2 is a great way to simplify your application structure. One of the first things you will find yourself doing is nesting one resource inside another. This is just the RESTful way of working with has_many relationships. The first couple times I did this, I forgot some of the steps (particularly changing the url paths in the controllers). So, I'm going to iterate the steps here -- hopefully this will help someone going through the learning process on Rails 1.2 CRUD.

Continue reading "Nested CRUD resources in Rails 1.2" »

iPhone

Jan 09 by Andre in Gadgets »

My favorite excerpt from the news coming out of MacWorld:

With a few finger taps, Jobs demonstrated how to pull up a Google Maps site and find the closest Starbucks to the Moscone Center. He then prank-called the cafe and ordered 4,000 lattes to go before quickly hanging up.

On a more serious note: with the range of features announced on the iPhone (phone, music, media synching, GPS, WiFi, Bluetooth), I hope Apple is able to maintain their trademark simplicity and ease of use. The more features you pack into something, the more difficult it is to provide intuitive access to all of them.

That said, looking at the interface demos over at the Apple site -- it looks pretty good!

Four choices to Jumpstart your Rails App

Jan 06 by Andre in Ruby on Rails »

AutoAdmin

No code generation; goal is to provide a Django-like dynamic admin interface with minimal effort. Takes a "either it works for you or it doesn't" approach, because there's no code to edit or customize if you don't like what AutoAdmin gives you. http://code.trebex.net/auto-admin/

Streamlined

Code generation backed by dynamically generated interfaces. Goal is "to bring the declarative goodness of ActiveRecord to the view layer. It manages the presentation, creation and editing of instances of your models, with full-featured scaffolds that include relationship management."

Unfortunately, the streamlined site hasn't been updated in a while. http://streamlined.relevancellc.com/

Hobo

The newest project, and probably the most ambitious one. Hobo has its own templating language, a library of custom tags, theme support, and user login/access control baked in. http://hobocentral.net/blog/

Ajax Scaffold

"A Ruby on Rails plugin that creates an AJAX'ified scaffold for controllers. Sister project of the Ajax Scaffold Generator. Extends the work of the base RoR scaffolds with AJAX and full CSS styling." http://www.ajaxscaffold.com