# Simpel question (scaffold?) :(

**URL:** <https://www.ruby-forum.com/t/simpel-question-scaffold/85491>\
**Category:** Rails\
**Created:** [February 14, 2007, 12:33am UTC](https://www.ruby-forum.com/t/simpel-question-scaffold/85491 "2007-02-14T00:33:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [February 14, 2007, 12:33am UTC](https://www.ruby-forum.com/t/simpel-question-scaffold/85491/1 "2007-02-14T00:33:05Z")

</div>

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/](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

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [February 14, 2007, 12:36am UTC](https://www.ruby-forum.com/t/simpel-question-scaffold/85491/2 "2007-02-14T00:36:23Z")

</div>

Just scaffold :blog, not :blogs

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [February 14, 2007, 12:38am UTC](https://www.ruby-forum.com/t/simpel-question-scaffold/85491/3 "2007-02-14T00:38:11Z")

</div>

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 ☹ ?

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [February 14, 2007, 1:04am UTC](https://www.ruby-forum.com/t/simpel-question-scaffold/85491/4 "2007-02-14T01:04:29Z")

</div>

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/](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!
