OSCON 2006: Rails Guidebook

Dave Thomas runs The Pragmatic Programmers company with Andy Hunt. He and Hunt co-authored The Pragmatic Programmer and Programming Ruby (AKA ‘The Pickaxe Book’). Mike Clark is co-author of Agile Web Development with Rails, author of Pragmatic Project Automation, and co-teaches Pragmatic Studio: Ruby on Rails.

This tutorial was in one of the larger rooms, and was (predictably) very full. It was mostly just a solid, step-by-step intro to Rails — naturally including the standard Rails demo of rapidly building a basic application. Beyond the basic introduction of a Rails app structure (i.e., what files go where), and how to build a Rails app, they also went into a few other areas of Rails development that I found interesting:

Migrations

Migrations provide a procedural way (in Ruby code, natch) to create and modify your database schema. This is useful if you want a database-independent way to maintain your schema. They are also be helpful in keeping multiple developers in sync with structural changes to your database. Migrations are also reversible, so you can undo changes if you don’t like them.

Model finder methods

They demonstrated how to combine different arguments for find. Seeing some of the different ways to do it is helpful for someone like me who tends to use find_by_sql as a crutch.

Many-to-many associations

Rails is known for being extremely good a managing simple data models, including basic one-to-one, and one-to-many relationships. Now you can deal with slighly more complicated setups a bit better. The original way to deal with many-to-many relationships was a simple join table that doesn’t show up in your model anywhere. The newer way is with something called a ‘through association’ which is an object you actually put in your model, where you can also hang meta-data about the association (e.g. an Order has many Items, and each Item association has a UnitPrice and Quantity).

Generating XML

It’s super simple to convert your results set to XML by giving your template an ‘rxml’ extension, which uses a programmatic builder template instead of the normal mix of markup and RHTML tags.

Simply RESTful

Simply RESTful is a Rails plugin for routing that maps the HTTP ‘verbs’ for REST-style communication to the URL paths for the common CRUD actions in Rails (e.g. POST = ‘create’, PUT = ‘update’, DELETE = ‘destroy’, etc.).

Replay

Category: programming Time: 2006-08-05 Views: 0
Tags:

Related post

  • OSCON 2006: Django: Web Development with Journalists' Deadlines 2006-07-27

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Lead developer Jacob Kaplan-Moss bills Django as a competitor to Ruby on Rails. Django is a web development framework that was born at a small community newspaper in the city of Lawr

  • OSCON 2006: Practical OpenID 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. David Recordon (Six Apart, then Verisign) and Brian Ellin (JanRain) have had their fingers in OpenID since its inception. OpenID is an open user authentication system based on the pr

  • OSCON 2006: Rock-solid Web Development: Testing Web Apps 2006-07-26

    All this week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Presenter John Paul Ashenfelter provided the standard sales pitch for testing, but with a web development spin, and demonstrated both Selenium (a rich, in-browser testing framewo

  • OSCON 2006: Tim O'Reilly keynote 2006-07-27

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Kicking off the first day of open sessions at OSCON today, Tim O'Reilly gave his perspectives on the state of open source, and some of the big ideas currently making waves: Architect

  • OSCON 2006: Ajax Optimization Techniques 2006-07-27

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Kevin Henrikson of Zimbra gave a brisk presentation covering some of the lessons his organization has learned and the "dirty tricks" it has implemented to improve the performanc

  • OSCON 2006: Cross-site Ajax 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Paralyzed by indecision (at any given time at OSCON, there are literally three different sessions I would consider "must-see" going on), I went to Plaxo developer Joseph Smarr's

  • OSCON 2006: Gettting Rich with PHP5 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. PHP's creator, Rasmus Lerdorf, gave a surprising talk on building PHP rich web applications using PHP5-suprising, because fully half the talk focused on low-level PHP optimization te

  • OSCON 2006: Understanding ZFramework 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. John Coggeshall is a respected name in the PHP world, and works as a technical consultant for Zend, and provided a fast-paced introduction to the Zend Framework as it currently exist

  • OSCON 2006: Web Heresies: The Seaside Framework 2006-07-28

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Avi Bryant has the dubious distinction of being one of the few web geeks with an avid interest in Smalltalk, and has created a web application development framework that suits his pa

  • OSCON 2006: Cosmo and Scooby: Standards-Based Open Source Calendaring 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Developed by the Open Source Applications Foundation (OSAF), Cosmo is a service enabling its users to put their personal information online and share it with others via open protocol

  • OSCON 2006: No Flash Required: Interactive Browser Graphics 2006-07-29

    This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR. Gavin Doughtie has done stints in games development for Sony, web development for idealab, and software development for Picasa, but these days he works at DreamWorks Animation (yes,

  • OSCON 2006: When Interface Design Attacks 2006-08-05

    Amy Hoy is the author of a Ruby on Rails- and design-oriented blog, Slash7. I was amazed to see how packed this session was. They propped the doors open, and people were actually standing around outside the door trying to listen. It was really good t

  • OSCON 2006: Big Bad PostgreSQL 2006-08-05

    Theo Schlossnagle is a principal at OmniTI Computer Consulting, working in the areas of scalable internet architectures, database replication, and e-mail infrastructure. This talk was on converting a really large (over 3 terabytes, largest table is 1

  • OSCON 2006: TimeTravel Tables in PostgreSQL 2006-08-05

    A. Elein Mustain is a veteran developer of Ingres, Illustra, and Informix, and is the author of the weekly PostgreSQL General Bits column. Elein showed how to use timestamps to keep an audit trail of all changes in your DB. With this technique, you n

  • Oct 23, 2006 News Wire 2006-10-24

    IE 7 vs IE 6 Based on some in house testing at Zimbra, IE 7 has made some significant leaps forward in memory management and JavaScript performance. Despite this, Firefox still outpaces the browser in their testing. (tags: ie firefox javascript) Dojo

  • The State of ColdFusion 2006-10-26

    The following is republished from the Tech Times #151. In issue 145 of the Tech Times, I offered some advice on which web technologies beginners should invest time in learning. Ben Forta, the Senior Technical Evangelist at Adobe, felt I misrepresente

  • Jul 3, 2006 News Wire 2006-07-04

    Can You Hear Me Now? Did you assume aural style sheets were little more than a pleasant fiction? It turns out that several client programs do support them (Emacspeak, Fonix SpeakThis, and Opera among them). This article explains the basics. (tags: cs

  • Jul 11, 2006 News Wire 2006-07-12

    Memory Leak Patterns in Internet Explorer An interesting MSDN article about how memory leaks come about in IE and its JavaScript engine. (tags: ie javascript) JSON, Ajax, and UTF8 A nice summary of how to implement JSON data transfer from the client

  • Jul 19, 2006 News Wire 2006-07-20

    Json.NET 1.1 released James Newton-King's .NET library to ease communication between AJAX frontends and .NET web applications using JSON has been updated. The new version includes seamless XML to JSON translation. (tags: xml javascript ajax .net) Kee

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.257 (s). 13 q(s)