# Aurigma Image uploader

**URL:** <https://www.ruby-forum.com/t/aurigma-image-uploader/171103>\
**Category:** Rails\
**Created:** [June 26, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103 "2009-06-26T13:52:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pravinhmhatre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Post date:** [June 26, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103/1 "2009-06-26T13:52:38Z")

</div>

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](http://localhost:3000/profile/2/images), but server  
redirects are not supported.

Please help me out of this.

---

<div class="post-metadata">

**Author:** ![pravinhmhatre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Post date:** [June 26, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103/2 "2009-06-26T14:50:57Z")

</div>

Pravin M. wrote:

> Please help me out of this.

Kind of hard when we have no example from your code…

What does your controller code look like?

---

<div class="post-metadata">

**Author:** ![pravinhmhatre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Post date:** [June 26, 2009, 2:53pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103/3 "2009-06-26T14:53:32Z")

</div>

Ar Chron wrote:

> Pravin M. wrote:
> 
> > Please help me out of this.
> 
> Kind of hard when we have no example from your code…
> 
> What does your controller code look like?

Here is my controller code

def create  
no\_of\_files = 0  
params\_keys = params.keys.size  
for k in 0…params\_keys  
no\_of\_files += 1 if params[“SourceFile\_#{k}”]  
end  
if no\_of\_files \< 4  
@advert = Advert.find(params[:advert\_id])  
for i in 1…no\_of\_files  
@image = Image.new  
@image.photo = params[“SourceFile\_” + i.to\_s]#.first  
@image.image\_type = “Advert”  
@advert.images \<\< @image  
end  
redirect\_to advert\_path(@advert)  
#render :template =\> “adverts/show”  
else  
flash[:error] = “You can upload maximum 4 images for an advert.”  
redirect\_to adverts\_path  
end  
end

---

<div class="post-metadata">

**Author:** ![pravinhmhatre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Post date:** [June 29, 2009, 2:16pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103/4 "2009-06-29T14:16:28Z")

</div>

Hello,

Please read discussion on this problem on Aurigma managed forums:

> **[Aurigma image uploaderin rails](https://forums.aurigma.com/yaf_postst3688_Aurigma-image-uploaderin-rails.aspx)**
>
> 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...

On 26 Ð¸ÑŽÐ½, 19:54, Pravin M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![pravinhmhatre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e99b99/32.png) [@pravinhmhatre](https://www.ruby-forum.com/u/pravinhmhatre)\
**Post date:** [June 26, 2009, 2:54pm UTC](https://www.ruby-forum.com/t/aurigma-image-uploader/171103/5 "2009-06-26T14:54:58Z")

</div>

> Here is my controller code  
> Also,  
> protect\_from\_forgery :except =\> [“create”]
