jamal
1
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
jamal
2
Just scaffold :blog, not :blogs
jamal
3
Guest wrote:
Just scaffold :blog, not :blogs
Thanks for answering me so fast 
I just tried this, and still the error message didn’t change
?
jamal
4
Jamal S. 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 
-Never give up!