rubyonrailsin

A Ruby and Rails talk

Monday, March 29, 2010


[Rails] Re: upload thru IFRAME

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

On Mar 29, 8:37 am, HUNT HUNT <li...@ruby-forum.com> wrote:
> 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

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive