Re: html option in form_for errors

Frederick Cheung
2008-01-15T12:08:48Z

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
> >