# Silent redirect to index action when uploading images

**URL:** <https://www.ruby-forum.com/t/silent-redirect-to-index-action-when-uploading-images/125012>\
**Category:** Rails\
**Created:** [January 4, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/silent-redirect-to-index-action-when-uploading-images/125012 "2008-01-04T16:08:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mknw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@mknw](https://www.ruby-forum.com/u/mknw)\
**Post date:** [January 4, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/silent-redirect-to-index-action-when-uploading-images/125012/1 "2008-01-04T16:08:42Z")

</div>

All,

I’m creating a simple image gallery in my rails app and have a problem  
uploading images on production environment (it works perfectly on my  
local machine).

I’m hosting it on dreamhost on Apache+FastCGI, with my own Ruby  
compiled and Rails 2.0.1 installed in local directory plus Rick  
Olson’s AttachmentFu for image uploading. I may have some image  
libraries misconfigured, or something, but I cannot tell, because I  
cannot see anything in the Rails log file when I click “Submit” in my  
browser.

Apache access.log shows me this:

nnn.nnn.nnn.nn - - [04/Jan/2008:01:05:39 -0800] “POST /images HTTP/  
1.1” 301 601  
“[http://myapp.example.com/images/new?image[album\_id]=1](http://myapp.example.com/images/new?image%5Balbum_id%5D=1)” “Mozilla/  
4.0  
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET  
CLR 2.0.507  
27; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)”  
nnn.nnn.nnn.nn - - [04/Jan/2008:01:05:41 -0800] “GET /images/ HTTP/  
1.1” 200 1525  
“[http://myapp.example.com/images/new?image[album\_id]=1](http://myapp.example.com/images/new?image%5Balbum_id%5D=1)” “Mozilla/  
4.  
0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET  
CLR 2.0.50  
727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)”

Nothing appears in Apache error.log and in Rails production.log all I  
can see is:

Processing ImagesController#index (for nn.nnn.nnn.nn at 2007-12-22  
16:24:57) [GE  
T]  
Session ID:  
BAh7CToOcmV0dXJuX3RvMDoMY3NyZl9pZCIlOWUyOWU0ZTllZDMyOWUyMTJl%0ANDF  
hOTczYTc5Y2E2NDU6CXVzZXJpBiIKZmxhc2hJQzonQWN0aW9uQ29udHJv  
%0AbGxlcjo6Rmxhc2g6OkZs  
YXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D–  
bcbf702a2ea8014671ecf0d66db743be9f20a1eb  
Parameters: {“action”=\>“index”, “controller”=\>“images”}

No mention of the POST request _at all_ in the production.log. Just  
the 301 redirect and since I’m not implementing index action in this  
model, I get a 404 after this call.

Anyone has any ideas why the 301 redirect may occur or where I can see  
anything logged?

Thanks,  
Maciek

---

<div class="post-metadata">

**Author:** ![mknw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@mknw](https://www.ruby-forum.com/u/mknw)\
**Post date:** [February 1, 2008, 4:16pm UTC](https://www.ruby-forum.com/t/silent-redirect-to-index-action-when-uploading-images/125012/2 "2008-02-01T16:16:58Z")

</div>

OK, I’m responding to my own post, but… problem solved.

It appears that having a model named Image wasn’t a very good choice.  
It somehow collided with .htaccess rewriting rules and apache  
redirected the request. Changing model name to Picture helped.
