# Restful Routes Malfunction

**URL:** <https://www.ruby-forum.com/t/restful-routes-malfunction/135282>\
**Category:** Rails\
**Created:** [April 20, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/restful-routes-malfunction/135282 "2008-04-20T16:51:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_Merrell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Will\_Merrell](https://www.ruby-forum.com/u/Will_Merrell)\
**Post date:** [April 20, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/restful-routes-malfunction/135282/1 "2008-04-20T16:51:30Z")

</div>

My rails application is working correctly for everything except one  
controller/action.

In development on my local machine it all works fine, but when deployed  
to the production environment, the ‘new’ form is mis-routed when  
submitted. Instead of calling the ‘create’ action as it should it goes  
directly to the ‘index’ action and the ‘create’ is never called.

The form in question is a photo upload form. The generated form tag is:

The routes as shown by ‘rake routes’ are:

```
                photos GET /photos

```

{:controller=\>“photos”, :action=\>“index”}  
formatted\_photos GET /photos.:format {:controller=\>“photos”,  
:action=\>“index”}  
POST /photos  
{:controller=\>“photos”, :action=\>“create”}  
POST /photos.:format  
{:controller=\>“photos”, :action=\>“create”}

The production log shows that right after the ‘new’ action the next  
action is the ‘index’ action.

All of this works in development, other very similar controllers that  
don’t have the enctype=“multipart/form-data” (that is just normal text  
forms) work just fine, the behavior is the same on different browsers.  
The production environment is fastcgi, while the development environment  
is a standard mongrel. Both are Rails 2.0.2.

So, My question is Why do this not work? Why does this one form go to  
the GET action when it should go to the POST action?

Any help or suggestions would be appreciated.

– Will Merrell

---

<div class="post-metadata">

**Author:** ![Will\_Merrell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Will\_Merrell](https://www.ruby-forum.com/u/Will_Merrell)\
**Post date:** [May 4, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/restful-routes-malfunction/135282/2 "2008-05-04T20:14:00Z")

</div>

Just found this post – I’m having the exact same problem, did you  
find a solution?
