Hi, I’m fairly a noob to rails, and just trying to grasp the entire
structure and concept. I think I’m getting it for the most part, but
just can’t seem to get past this error.
I keep getting “Action Controller” page with the error:
“undefined local variable or method `new_courses_path’ for
#ActionView::Base:0x23370f0”.
Ok, so let me tell you what I am doing so that you can understand. I
create a mysql connected rails app called training. So there is no
confusion, I have already created the database, and it works fine.
prompt>rails -d mysql training
Ok, so that is created. Then I create a scaffold to save time from
having to create the model, view, and controller. And I create it
telling it which db fields to create with it. To make this example
simple, I’ll just do 3 db fields: title (the course title) of varchar,
description (course description) as text, and course_num (to locate
the course faster in the db) as an integer.
prompt>cd training
prompt>script/generate scaffold courses \
title:string description:text course_num:integer
And then I hit enter. It generates my model, view, and controller for
me, so then I fire up Mongrel.
prompt>script\server
And then I go to localhost:3000/courses in my browser, and thats when
I get the error. I just cannot figure it out. I’ve created another app
with different names, bla bla bla, and it worked fine. Its just got me
stumped.
If someone could help me get some insight on the issue, it’d be much
appreciated.
Thanks,
Justin