%user_javascript%
Rapid Web Development

RoR lesson

Wa-hoo, I learned something today, and half the reason why I chose to blog this is so that I don't forget. Lately I have repeatedly attempted to create a scaffold with Locomotive without success. At first I thought that I had accidentally ruined the config by adding a flickr gem I was experimenting with, but I don't think that is so. The problem I had is with the msqlite schema in schema.sql and how I tried to update it and then generate a scaffold. First off here is the current schema.sql I have:

DROP TABLE monkeys;
create table monkeys (
id INTEGER PRIMARY KEY,
name VARCHAR(100));

DROP TABLE products;
create table products (
id INTEGER PRIMARY KEY not null,
title varchar(100) not null,
description text not null,
image_url varchar(200) not null,
price decimal(10,2) not null,
date_available datetime not null
);

DROP TABLE dogs;
create table dogs (
id INTEGER PRIMARY KEY,
name VARCHAR(100));

DROP TABLE cats;
create table cats (
id INTEGER PRIMARY KEY,
name VARCHAR(100));

DROP TABLE wdwresorts;
create table wdwresorts (
id INTEGER PRIMARY KEY,
name VARCHAR(100),
loc varchar(100));


Here are the steps I need to take in the future to avoid problems:

  1. Create the structure of the table before anything else.
  2. cd into the db directory of the app
  3. Execute this command: sqlite mydb < schema.sql
  4. Execute: cd..
  5. Execute: ruby script/generate scaffold [controllerName] [urlDirectory]

A good day of learning

Earlier, I wrote about starting up Ruby on Rails to be difficult. Having chatted with a few who know, I have somewhat changed my tune. This Ruby on Rails stuff is pretty good. It reminds me of the simplicity of the Roxen webserver, but that's old tech with a smaller community around it. Two bad things. So, out with the old, and into the new. The people on the IRC channel, #rubyonrails, has been able to help me with a few questions I had, like how do I get around all the configuration problems. I figured that since the community is all about getting things done, someone would figure out a better solution than manual installation for the Mac, and yup someone did, Locomotive, by Ryan Raaum. Just download it and drag it to the applications folder, sweet! It's a self contained application, including a webserver and a DB.

I got through the first seven chapters of Agile Web Development with Rails, enough to know how to create a website that uses a database to fill in the slots of a nice-looking page, not quite enough to create a cart or a session -- that's covered in the next chapters. I think I will take a break from studying and try to implement my new knowledge.

Ready, Steady, Stall

I have seen the rails demo of the creation, from scratch, of the framework and a couple entries to a blog in 15 minutes. Cool stuff. I just wish that I had someone show me how to do it on Site5. I seem to using Google and A9 a bit too much. Once I get the hang of rails, I imagine that I will producing websites at warp speed!

Starting to ROaR

I set the initial config of localyokel

Opened Site

Today I opened CarlBTanner.net