Routes.rb

Greetings,

I’ve just updated to Rails 2 and have rebuilt on of my apps, but I’m
having a headache with the paths. Please can someone explain to me what
I need to do.

The path is simple:

http://localhost:3000/home/en

which worked before, but now throws a 404 error.

In my routes.rb file I have:

map.connect “”, :controller=>“g_pub”, :action=>“index”,
:path=>[“home”,“en”]

for some reason it’s splitting up the path incorrectly. If I look at the
SQL that gets generated I see:

g_blocks.name=‘en’ AND g_blocks.location = ‘/home/’ AND
g_published_blocks.g_language_id=NULL

whereas what I really need is:

g_blocks.name=‘home’ AND g_blocks.location = ‘/’ AND
g_published_blocks.g_language_id=‘en’

In other words, I need the following values:

g_blocks.location --> /
g_blocks.name --> home
g_blocks.g_language_id --> en

but what I’m getting at the moment is:

g_blocks.location --> /home/
g_blocks.name --> en
g_blocks.g_language_id --> NULL

Can anyone see what I need to do? Many thanks.

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