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.
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
|
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: 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
|
|
|
|
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.