Routes.rb question

I’m trying to go to localhost/phrases/new

where ‘phrases’ is my controller and ‘new’ is my action which will
simply show my new.html.erb

In my routes i have:
map.connect ‘/:controller/:action’

Yet every time i go to phrases/new, I get redirected to my show action

http://pastie.org/356249

I can get around this if i use:
map.connect ‘/:controller/:action.’

But i find it distasteful to have that period at the end of my URL. Any
clue why everything gets redirected to :action => ‘show’

Richard,

Why not just lose this line from your routes file:

map.connect ‘/:controller/:action’

Since map.resources came along, I always delete the default stuff that
comes in the routes file. See if /phrases/new works the way it should
after removing that line.

– Josh
http://iammrjoshua.com

Richard S. wrote:

I’m trying to go to localhost/phrases/new

where ‘phrases’ is my controller and ‘new’ is my action which will
simply show my new.html.erb

In my routes i have:
map.connect ‘/:controller/:action’

Yet every time i go to phrases/new, I get redirected to my show action

http://pastie.org/356249

I can get around this if i use:
map.connect ‘/:controller/:action.’

But i find it distasteful to have that period at the end of my URL. Any
clue why everything gets redirected to :action => ‘show’

Try what was recommended and what does your controller look like?

On Jan 8, 10:29 pm, Joshua A. [email protected]