Hello their, Its very simple, here is my code: class BlogController < ActionController::Base scaffold :blogs end When I go to http://127.0.0.1:3000/blog/list/ I get this error: uninitialized constant Blog The table exist (blogs), but it doesn't allow me to use the default scaffold interface, why? Please any help, thanks :) Regards, Jamal
on 2007-02-14 00:33
on 2007-02-14 00:36
Just scaffold :blog, not :blogs
on 2007-02-14 00:38
Guest wrote: > > > Just scaffold :blog, not :blogs Thanks for answering me so fast :D I just tried this, and still the error message didn't change :( ?
on 2007-02-14 01:04
Jamal Soueidan wrote: > Hello their, > > Its very simple, here is my code: > > class BlogController < ActionController::Base > scaffold :blogs > end > > When I go to > http://127.0.0.1:3000/blog/list/ > > I get this error: > uninitialized constant Blog > > The table exist (blogs), but it doesn't allow me to use the default > scaffold interface, why? > > Please any help, thanks :) > > Regards, > Jamal I get it to work, if you had the same error, then you must remember that to set the table name in a model. ruby script/generate model blog then open the file blog.rb class Blog < ActiveRecord::Base set_table_name "blogs" end then go back to your controller: class BlogController < ApplicationController scaffold :blog; end Everything work :D -Never give up!