Hi,
there is no helper for form_for in UploadColumn yet, it''ll be in the
next version, till then you can replace
<% form_for :user do |f| -%>
with
<% form_for( :user, :html => { :multipart => true }) do |f| %>
that should do the trick, ugly though it is.
/Jonas
On 19 Juli, 09:41, Mister Yu
<eryan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I installed the plugin, but got stuck rewriting the view, from the
> homepage, it says:
>
> If you want the actual file to be sent you need to set the encoding of
> the form to multipart. There is a convenient method in UploadColumn
> that makes this really easy, instead of your usual form_tag
> declaration simply use upload_form_tag.
>
> but how exactly to change it? i m a newbie for ROR.
>
> my partial form looks like this, can someone help me to rewrite it?
> thanks.
>
> <%= error_messages_for :user %>
> <% form_for :user do |f| -%>
> <p><label for="login">Login</label><br/>
> <%= f.text_field :login %></p>
>
> <p><label for="email">Email</label><br/>
> <%= f.text_field :email %></p>
>
> <p><label
for="password">Password</label><br/>
> <%= f.password_field :password %></p>
>
> <p><label for="password_confirmation">Confirm
Password</label><br/>
> <%= f.password_field :password_confirmation %></p>
>
> <p>
> <label for="avatar">Upload A Mugshot:</label>
> <%= f.file_field :avatar %>
> </p>
>
> <p><%= submit_tag ''Sign up'' %></p>
> <% end -%>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---