Hi,
i started to test attachment_fu, but i can''t get it to upload a file.
See
the error:
NoMethodError (undefined method `content_type'' for
"/100_2261.jpg":String):
    /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in
`uploaded_data=''
I looked at the plugin code, but can''t figure out how to fix this
issue. I''d
appreciate any help.
Bye,
Tino
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 3/28/07, Tino Breddin <tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi, > > i started to test attachment_fu, but i can''t get it to upload a file. See > the error: > > NoMethodError (undefined method `content_type'' for "/100_2261.jpg":String): > > /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in > `uploaded_data='' > > I looked at the plugin code, but can''t figure out how to fix this issue. I''d > appreciate any help.Your form needs to be a multipart form. Use :multipart => true. http://rails.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601 -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I use the following form snippet:
form_remote_for(:image, :url => images_path, :html => {:multipart =>
true} ,
:update => "image") do |f|
And it is compiled to a multipart form as far as i see in my html code.
On 3/28/07, Rick Olson
<technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> On 3/28/07, Tino Breddin
<tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> > Hi,
> >
> > i started to test attachment_fu, but i can''t get it to upload
a file.
> See
> > the error:
> >
> > NoMethodError (undefined method `content_type'' for
> "/100_2261.jpg":String):
> >
> > /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in
> > `uploaded_data=''
> >
> > I looked at the plugin code, but can''t figure out how to fix
this issue.
> I''d
> > appreciate any help.
>
> Your form needs to be a multipart form.   Use :multipart => true.
>
>
>
http://rails.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601
>
>
> --
> Rick Olson
> http://lighthouseapp.com
> http://weblog.techno-weenie.net
> http://mephistoblog.com
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
You can''t use AJAX forms (form_remote_for uses a for file upload calls a XMLHttpRequest via the prototype js lib) with file uploads. Alternate methods for inline uploads utilize hidden forms. raja On 3/28/07, Tino Breddin <tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> I use the following form snippet: > > form_remote_for(:image, :url => images_path, :html => {:multipart => true} , > :update => "image") do |f| > > And it is compiled to a multipart form as far as i see in my html code. > > > On 3/28/07, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 3/28/07, Tino Breddin <tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > Hi, > > > > > > i started to test attachment_fu, but i can''t get it to upload a file. > See > > > the error: > > > > > > NoMethodError (undefined method `content_type'' for > "/100_2261.jpg":String): > > > > > > > /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in > > > `uploaded_data='' > > > > > > I looked at the plugin code, but can''t figure out how to fix this issue. > I''d > > > appreciate any help. > > > > Your form needs to be a multipart form. Use :multipart => true. > > > > > http://rails.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601 > > > > > > -- > > Rick Olson > > http://lighthouseapp.com > > http://weblog.techno-weenie.net > > http://mephistoblog.com > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
He, now it''s working. Thank you Raja. For the first contact with attachment_fu I will avoid using AJAX forms for such a scenario. Tino On 3/28/07, Raja Bhatia <raja.bhatia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > You can''t use AJAX forms (form_remote_for uses a for file upload > calls a XMLHttpRequest via the prototype js lib) with file uploads. > Alternate methods for inline uploads utilize hidden forms. > > raja > > On 3/28/07, Tino Breddin <tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > I use the following form snippet: > > > > form_remote_for(:image, :url => images_path, :html => {:multipart => > true} , > > :update => "image") do |f| > > > > And it is compiled to a multipart form as far as i see in my html code. > > > > > > On 3/28/07, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On 3/28/07, Tino Breddin <tino.breddin-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > Hi, > > > > > > > > i started to test attachment_fu, but i can''t get it to upload a > file. > > See > > > > the error: > > > > > > > > NoMethodError (undefined method `content_type'' for > > "/100_2261.jpg":String): > > > > > > > > > > /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in > > > > `uploaded_data='' > > > > > > > > I looked at the plugin code, but can''t figure out how to fix this > issue. > > I''d > > > > appreciate any help. > > > > > > Your form needs to be a multipart form. Use :multipart => true. > > > > > > > > > http://rails.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601 > > > > > > > > > -- > > > Rick Olson > > > http://lighthouseapp.com > > > http://weblog.techno-weenie.net > > > http://mephistoblog.com > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---