# Problem with routes and scaffold

**URL:** <https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340>\
**Category:** Rails\
**Created:** [April 21, 2008, 11:05am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340 "2008-04-21T11:05:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:05am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/1 "2008-04-21T11:05:29Z")

</div>

When I make a new scaffold I get a problem with routes. When adding a  
Leave table in the db using scaffold and migrate, and entering the index  
page I get “undefined local variable or method `new\_leave\_path’”. Same  
problem with another table, but ok with yet another. What could be  
wrong?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:09am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/2 "2008-04-21T11:09:49Z")

</div>

go to your route.rb and add this :

map.resources :name\_tables

example:  
map.resources :galleries

Then restart your server not your PC 😃

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:16am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/3 "2008-04-21T11:16:45Z")

</div>

Visit Indonesia 2008 wrote:

> go to your route.rb and add this :
> 
> map.resources :name\_tables
> 
> example:  
> map.resources :galleries
> 
> Then restart your server not your PC 😃
> 
> Reinhart  
> [http://teapoci.blogspot.com](http://teapoci.blogspot.com)

It’s already there, from the scaffold. Hmm. I have a feeling that it’s a  
problem with Rails.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:24am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/4 "2008-04-21T11:24:21Z")

</div>

Visit Indonesia 2008 wrote:

> what rails version do you created it?
> 
> Reinhart

2.0.2

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:30am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/5 "2008-04-21T11:30:13Z")

</div>

Visit Indonesia 2008 wrote:

> what rails version do you created it?
> 
> Reinhart

Might be what I do that is the problem. I added, edited and deleted  
tables from the db directly. Now I when I try a new scaffold with a test  
table it doesn’t get created.

I like scaffold to the the things up an running fast, but I don’t really  
use migrations as I find it faster to do it the old way editing the  
tables directly with CococaMySQL.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/6 "2008-04-21T13:47:03Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> Visit Indonesia 2008 wrote:
> 
> > go to your route.rb and add this :
> > 
> > map.resources :name\_tables
> > 
> > example:  
> > map.resources :galleries
> > 
> > Then restart your server not your PC 😃
> > 
> > Reinhart  
> > [http://teapoci.blogspot.com](http://teapoci.blogspot.com)
> 
> It’s already there, from the scaffold. Hmm. I have a feeling that it’s a  
> problem with Rails.

I believe the problem is that somehow Rails have an issue with certain  
names, in my case the name Leave and Leaves.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 21, 2008, 11:18am UTC](https://www.ruby-forum.com/t/problem-with-routes-and-scaffold/135340/7 "2008-04-21T11:18:20Z")

</div>

what rails version do you created it?

Reinhart
