Rad Quick Start Guide

Update: I abandoned Rad, links not work anymore.

In this guide we'll build simple Hello World application, it should take about 5-10 minutes.

Installing Rad

Note: it uses lots of other gems, so if you have the rvm manager it's better to install it in separate gemset. If you don't know what the rvm manager is, just ignore it.

gem install rad_core

Creating Blank Application

cd ~/my_projects
git clone git://github.com/alexeypetrushin/rad_blank_app.git
mv rad_blank_app my_hello_world_rad_app
cd my_hello_world_rad_app

Controller

Create the Pages Controller by placing code below into the ./app/controllers/pages.rb file.

class Pages
  inherit Rad::Controller::Http

  def index
  end
end

Views

Create index page template by placing code below into the ./app/views/controllers/pages/index.html.erb file.

Hello World!

Routes

Configure routes by placing code below into the ./config/routes.rb file.

rad.router.configure do |c|
  c.resource :pages, class_name: 'Controllers::Pages'
end

Running

Our Application is finished, let's run it, ensure that you are in the project folder and type:

rad

You should see something like:

RAD 0.2.1 starting in :development mode (at 2011-07-29 22:31:52)
RAD http server started on localhost:4000

Go to http://localhost:4000/pages/index and you should see the page with "Hello World!" message.

What's next?

Try to play with this classic sample blog app rad-sample.heroku.com (it's hosted using free Heroku instance and sometimes it takes about 10sec to start up, so please be patient) sources github.com/alexeypetrushin/rad_sample.