Problem with routes and scaffold

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?

go to your route.rb and add this :

map.resources :name_tables

example:
map.resources :galleries

Then restart your server not your PC :smiley:

Reinhart
http://teapoci.blogspot.com

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 :smiley:

Reinhart
http://teapoci.blogspot.com

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

Visit Indonesia 2008 wrote:

what rails version do you created it?

Reinhart

2.0.2

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.

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 :smiley:

Reinhart
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.

what rails version do you created it?

Reinhart

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs