I'm pretty much using the default env from the "Getting Started on Rails" guide: Fedora / Mongrel / SQLite. The 4 Day guide uses Winders / Apache / MySQL. So I was wondering if someone could follow my logic and correct when wrong.
So I start by creating the ToDo app:
1) rails ToDo
Then I create my db:
2) rake db:create
He wants me to create a table now, but his code won't work in SQLite, so I follow his next steps planning to get the table in there with the automated way RoR does this:
3) ruby script/generate model Category
4) ruby script/generate controller category
Step 3 generated a db/migrate/20100716103138_create_categories.rb for creating the table. So I modify this file to be:
class CreateCategories < ActiveRecord::Migration
create_table :categories do |t|
The "t.string :category" should create me a varchar type of column, the t.references :category should make a category_id key, and the t.timestamps should create created_at and updated_at fields like he has. So then to create it, I:
5) rake db:migrate
Next I do like he says and modify my app/controllers/category_controller.rb file to be:
class CategoryController < ApplicationController
And since I'm not using apache, I have to start my webserver (mongrel):
6) script/server -r
Now that this is started, I try to go to my website at http://myServer:3000, but of course that's the default index.html that tells me to set my routes. I have no clue what to set them to based on the 4 day toot. He never talks about setting the default page, only changes where apache points to go to the public folder. Well index.html is in there. When he browses though, he goes to category under the public folder. Well I don't even have a category file or folder under my public folder.
I'm lost, can someone please let me know all of the places where I messed up?