The name "photo[uploaded_data]" is fine, view looks fine, what does
your
controller and model look like?
You have validation errors - so what are you validating in the model?
Your controller does not appear to be creating the object correctly (i.e.
the fields aren''t getting populated), so what does it look like?
-Andrew
On 7/25/07, Mister Yu <eryan.yu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi all,
>
> I downloaded and installed attachment_fu, also i followed mike
clark''s
> tutorial from here http://www.clarkware.com/cgi/blosxom/2007/02/24
>
> but when i tried to upload a file, there are these error msgs:
> 5 errors prohibited this photo from being saved
>
> There were problems with the following fields:
>
> * Content type is not included in the list
> * Content type can''t be blank
> * Size is not included in the list
> * Size can''t be blank
> * Filename can''t be blank
>
> actually, this has been mentioned before, but i didn''t see any
> solution.
>
> here''s my new.rhtml:
> <%= error_messages_for :photo %>
>
> <% form_for(:photo, :url
> =>{:controller=>"photo", :action=>"create"} ,
:html => { :multipart =>
> true }) do |f| -%>
> <p>
> <label for="photo">Upload A Photo:</label>
> <%= f.file_field :uploaded_data %>
> </p>
> <p>
> <%= submit_tag ''Create'' %>
> </p>
> <% end -%>
>
> and here''s the ACTUAL html file it returns:
>
> <form action="/photo/create"
enctype="multipart/form-data"
> method="post"> <p>
> <label for="photo">Upload A Photo:</label>
> <input id="photo_uploaded_data"
name="photo[uploaded_data]"
> size="30" type="file" />
> </p>
> <p>
> <input name="commit" type="submit"
value="Create" />
> </p>
>
> </form>
>
> the "name" is actually "photo[uploaded_data]" but not
upload_data, how
> do i fix this?
>
> thanks.
>
>
> >
>
--
Andrew Kuklewicz
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---