Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
pravinhmhatre  
#1 Posted : Thursday, June 25, 2009 8:38:21 PM(UTC)
pravinhmhatre

Rank: Newbie

Groups: Member
Joined: 6/25/2009(UTC)
Posts: 1

Hi,
Any one have any idea about using aurigma image uploader in rails.
I am trying to implement it in my application.
I followed following steps:
Copied HTML source in index.rb to index.html.erb
Installed paperclip to store images.
The request to upload sent to create method in images_controller
Retrieve images from post data
Save images to DB through paperclip

My code works fine till this point. Images are cropped, saved properly to DB.
But after that when I want to redirect it gives me error in a alert box saying
Server attempted to redirect you to http://localhost:3000/profile/2/images, but server redirects are not supported.

Please help me out of this.
Tamila  
#2 Posted : Sunday, June 28, 2009 2:22:23 PM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hello,

Quote:
But after that when I want to redirect it gives me error in a alert box saying
Server attempted to redirect you to http://localhost:3000/profile/2/images, but server redirects are not supported.

It is a known problem. I recommend you to read the following article:
"The server attempted to redirect, but server redirects are not supported". What is wrong?
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
ebirm  
#3 Posted : Friday, July 24, 2009 12:32:55 PM(UTC)
ebirm

Rank: Newbie

Groups: Member
Joined: 7/19/2009(UTC)
Posts: 1

I got around this by...

1. In your controller, for the action that handles the images, instead of a regular render (same name view) or a redirect_to (in your case), use the following:

Code:
render :text => ""


A zero length string will send an http 200, which tells Aurigma the file was uploaded correctly. You won't get a blank page (nothing happens, which is what you want).

2. In your view, set the following for Aurigma:

Code:
iu.addParam("RedirectUrl", "/{your_controller}/{your_action}/{your_id_if_needed}");


This tells Aurigma that after everything is uploaded and it gets an http 200, that it should redirect the page to the specified controller/action/id. I simply refresh (via the above) the same page so it shows the thumbnails of the images just uploaded. Works pretty sweet.

Edited by user Friday, July 24, 2009 12:40:29 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.