This is the conclusion of Ramaze by Example, a tutorial on web development. In Part 11: Validation and Error Handling, we added a custom error page and handlers for common user errors.
Having gone through this tutorial, you should now know about:
- installing Ramaze
- setting up a database schema
- creating a base Ruby file for an application
- models and using them to interface with the database
- views
- interpolating data into views
- controllers
- the relationship between requests, controller methods and views
- how to implement basic CRUD operations
- handling HTTP POSTed data
- using layouts for consistent page appearance
- where Ramaze gets static files from
- basic built-in Ramaze methods and helpers, like the link, flash and redirect helpers
- handling errors and displaying error messages
Armed with this information, you should be well-equipped to build a small web application of your own right now.
Learning More
This tutorial has covered a fair bit, but there are actually considerably more features and functions of Ramaze that I didn’t discuss. Some of these are:
- partials or elements
- session variables
- aspects
- testing
- routing
- deployment
- form helpers and scaffolding generators
- cooperation with Javascript, AJAX
- … and more!
I hope to cover some of these things in future blog posts. You can subscribe to my blog via RSS or by email.
Here are some resources you can reference to learn more about Ramaze:
- ramaze.net, the official website
- The RubyConf 2008 Ramaze presentation by Luc Castera
- The original todolist tutorial by manveru
- The Ramaze codebase – no really, you can learn a lot from it, and the code is easy to read, and very well commented
- The examples/ dir of the Ramaze codebase
- ramaze-book, a partially complete e-book written by manveru
- The codebase of sociar, an open source social networking platform. Sociar is pretty much the de facto, comprehensive Ramaze example, written by manveru himself.
- The #ramaze IRC channel and mailing list
Get Started!
# gem install ramaze
require 'ramaze' class MainController < Ramaze::Controller def index "Hello, world!" end end Ramaze.start
What are you waiting for? Write your first single-file web application right now!
Then stop by our IRC channel and say hello. We’d love to hear from you.
Related posts:
Just wanted to add three small examples from my blog to the resources section:
Using multiple databases and application slices in one file, 50 loc
Using scaffolding extensions with Ramaze
A minimal CMS module in Ramaze
[...] Ben: Just wanted to add three small examples from my blog to the resources section: Using multiple databa… [...]
Pistos – smashing series, only just seen them! Hoping to be doing some more Ramazing soon…
Here’s my little guide on partial rendering – though I’m not sure how up-to-date it is.