Welcome Guest | Login

restful routes malfunction

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 on hostingrails, 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:
<form action="/photos" class="new_photo" enctype="multipart/form-data" id="new_photo" method="post">
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 jsut 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?

-- Will Merrell

2008-04-20 08:19 AM

-- Will
I'm having the same exact problem.  I take it from the almost 5 months of silence this isn't something that can be fixed?

It really sucks if that is the case.

2008-09-15 06:25 PM

Actually, one of the techs fixed it the next day. He just did it on private email so you don't see it.

The problem seems to be that fastcgi is brain dead on 2.0.2. The fix was to put my site on mongrel and it has worked fine every since. If you can do that, that is the easiest solution. If you can't (or don't know how) I would suggest submitting a trouble report and seeing what the techs can do for you.

--Will

2008-09-15 08:49 PM

-- Will
Hi Glen,

Please post a ticket to support department with necessary details. We will configure this application to run under mongrel support.

2008-09-15 09:09 PM

Regards,
Rahul
Thanks Will,

Hopefully there is a solution that doesn't involve upgrading my hosting plan.

-Glen

2008-09-15 09:25 PM

Thanks Rahul,

I guess I should refresh before I post ;)  I submitted a ticket a little while ago.

-Glen

2008-09-15 09:26 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.