Prev | Current Page 424 | Next

Brad Ediger

"Advanced Rails"

00
# Another Client 12.40
Incorporating Rails Components | 287
printf "%-20s%5.2f", client.name, hours
end
end
Other Ruby applications
ActiveRecord can be used as a library in any Ruby application, and it is great for rapidly
prototyping simple interfaces to a database. The database interface can be selfcontained,
which makes it easy to integrate with existing applications; it will coexist
with other libraries such as Ruby-DBI.
The rapid prototyping aspect is key; ActiveRecord provides a consistent interface to
many database management systems, and you can use this interface to abstract away
the database details while building an application. An application can theoretically
be developed on a laptop with SQLite and deployed on a big-iron server running
Oracle (in practice, this is not a perfect transition, but it is somewhat easier than
working with the individual database libraries).
Gregory Brown wrote an article that walks through the process of building a to-do
list console application from the ground up with Ruby and ActiveRecord, without
using code generation. The article is available from http://www.oreillynet.com/pub/a/
ruby/2007/06/21/how-to-build-simple-console-apps-with-ruby-and-activerecord.html.
ActionMailer
Using ActionMailer to send emails from outside of Rails is a simple process as well. It
requires slightly more configuration, but not by much.


Pages:
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436