# Using image with submit\_to\_remote

**URL:** <https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624>\
**Category:** Rails\
**Created:** [July 21, 2008, 9:45am UTC](https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624 "2008-07-21T09:45:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [July 21, 2008, 9:45am UTC](https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624/1 "2008-07-21T09:45:22Z")

</div>

Hi  
How can I give an image to submit\_to\_remote .I could successfully do  
it with link\_to\_remote as below…But the same not working with  
submit\_to\_remote

\<%= link\_to\_remote( image\_tag("/images/cancel.png", {:alt =\>  
‘Cancel’, :class=\>“noborder”,:title=\>“Cancel”}),  
{:update =\> “search\_contact\_div”,  
:url =\> {:controller =\> ‘admin’, :action =\>  
‘search\_contact\_cancel’}}  
) %\>

```
                         Please help

```

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [July 21, 2008, 11:54am UTC](https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624/2 "2008-07-21T11:54:16Z")

</div>

Sijo Kg wrote:

> ```
> ) %>
> 
> Please help
> 
> ```
> 
> ## Thanks in advance Sijo
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

it should be something like this…

\<% form\_remote\_tag(:url =\> { :action =\> :foo}, :complete =\>  
“do\_some\_cool\_ajax(request);”) do %\>  
--------------------------------  
--------------------------------  
--------------------------------  
--------------------------------  
\<%= image\_submit\_tag(image\_url)%\>  
\<% end %\>

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [July 21, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624/3 "2008-07-21T13:10:51Z")

</div>

Hi,  
This is sad to say, there is no direct way of image or file uploading  
using form\_remote\_tag or link\_to\_remote.  
For that we have different way to do.  
This link will really help ajax image or file upload, uses iframes…  
go through this  
[http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment\_fu-and-responds\_to\_parent](http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent)

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [July 21, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/using-image-with-submit-to-remote/143624/4 "2008-07-21T13:32:15Z")

</div>

Hi  
Thanks for the reply.But What I need is not ajax file upload .Use  
an image as a title with the submit\_to\_remote instead of text title…I  
could do it with link\_to\_remote :submit option now.(For that i had to  
change all my code using submit\_to\_remote with link\_to\_remote).But would  
like to know how can i apply it with submit\_to\_remote

Sijo
