Re: html option in form_for errors

myst_tt
2008-01-15T12:19:32Z

Thank you ..... again, frederick..  now, I knows what stupid mistake
I''ve made

On Jan 15, 2:08 pm, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> On 15 Jan 2008, at 12:07, myst_tt wrote:
>
>
>
> > Hello, everyone:
> >     I tried the html option (multipart) to upload an image to
> > server , but the form_for always errors. If I remove the html option,
> > it works. I have no idea the reason, looks like it is only a syntax
> > error, but couldn''t figure it out.
> >    Thanks a lot in advance!
>
> form_for([@task, @comment], :html => {:multipart => true})
>
>
>
> > Br,
> > Myst
>
> > ============> > <% form_for([@task, @comment]), :html =>
{:multipart => true} do |f|
> > %>
> >
> > Comment body
> >    <%= f.text_area :desc %>
> >
> > <label
for="comment_image">Image
> >    <%= file_column_field ''comment'',
''image'' %>
> >
> >    <%= f.submit button_name %>
> >
> > <% end %>
> > ===========>
> > compile error
> > /home/fs/xxiao/3rdRail/workspace/ww/app/views/comments/
> > _comment.html.erb:1: syntax error, unexpected '','',
expecting kEND
> > _erbout = '''';  form_for([@task, @comment]), :html
=> {:multipart =>
> > true} do |f| ; _erbout.concat "\n"
> >                                           ^
> > /home/fs/xxiao/3rdRail/workspace/ww/app/views/comments/
> > _comment.html.erb:1: syntax error, unexpected kDO, expecting kEND
> > _erbout = '''';  form_for([@task, @comment]), :html
=> {:multipart =>
> > true} do |f| ; _erbout.concat "\n"
>
> > ^
> > /home/fs/xxiao/3rdRail/workspace/ww/app/views/comments/
> > _comment.html.erb:13: syntax error, unexpected kEND, expecting $end