# Routes.rb question

**URL:** <https://www.ruby-forum.com/t/routes-rb-question/157274>\
**Category:** Rails\
**Created:** [January 9, 2009, 2:06am UTC](https://www.ruby-forum.com/t/routes-rb-question/157274 "2009-01-09T02:06:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [January 9, 2009, 2:06am UTC](https://www.ruby-forum.com/t/routes-rb-question/157274/1 "2009-01-09T02:06:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [January 9, 2009, 5:29am UTC](https://www.ruby-forum.com/t/routes-rb-question/157274/2 "2009-01-09T05:29:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [January 9, 2009, 6:29am UTC](https://www.ruby-forum.com/t/routes-rb-question/157274/3 "2009-01-09T06:29:26Z")

</div>

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

On Jan 8, 10:29 pm, Joshua A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
