# Upload thru IFRAME

**URL:** <https://www.ruby-forum.com/t/upload-thru-iframe/185922>\
**Category:** Rails\
**Created:** [March 29, 2010, 9:37am UTC](https://www.ruby-forum.com/t/upload-thru-iframe/185922 "2010-03-29T09:37:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [March 29, 2010, 9:37am UTC](https://www.ruby-forum.com/t/upload-thru-iframe/185922/1 "2010-03-29T09:37:30Z")

</div>

I created one Prototype helper.In that a method with following name is  
there

def form\_remote\_tag\_with\_multipart\_support(options = {}, &block)  
if options[:html][:multipart]  
uid = “a#{Time.now.to\_f.hash.abs}”  
options[:html].merge!(:target =\> uid)  
iframe = capture\_haml do  
haml\_tag :iframe, :class =\> ‘hidden’, :id =\> uid, :name =\> uid,  
:src =\> ‘about:blank’  
end  
url\_for\_options = options[:html].delete(:action) ||  
url\_for(options[:url])  
if block\_given?  
haml\_concat iframe  
form\_tag url\_for\_options, options[:html], &block  
else  
\<\<-html  
#{iframe}  
#{form\_tag url\_for\_options, options[:html]}  
html  
end  
end  
end  
end

on view I write  
\<%= form\_remote\_tag\_with\_multipart\_support :service\_list, :url=\>  
service\_path, :method =\> :post do |f|\>  
\<% render :partial=\> “form” %\>  
\<%end%\>

its giving ActionView::TemplateError

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [March 29, 2010, 9:57am UTC](https://www.ruby-forum.com/t/upload-thru-iframe/185922/2 "2010-03-29T09:57:00Z")

</div>

On Mar 29, 8:37 am, HUNT HUNT [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> end
> end
> 
> ```
> 
> its giving ActionView::TemplateError  
> What’s the stack trace behind the error? For starters your helper  
> doesn’t check that options[:html] exists, you’re calling it with a  
> different number of parameters than you defined it with and you’re  
> using \<%= even though you’re passing it a block.

Fred
