# Html option in form\_for errors

**URL:** <https://www.ruby-forum.com/t/html-option-in-form-for-errors/126100>\
**Category:** Rails\
**Created:** [January 15, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/html-option-in-form-for-errors/126100 "2008-01-15T13:08:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 15, 2008, 1:08pm UTC](https://www.ruby-forum.com/t/html-option-in-form-for-errors/126100/1 "2008-01-15T13:08:34Z")

</div>

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!

Br,  
Myst

=============  
\<% form\_for([@task, @comment]), :html =\> {:multipart =\> true} do |f|  
%\>

**Comment body**  
 \<%= f.text\_area :desc %\>

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

---

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 15, 2008, 1:09pm UTC](https://www.ruby-forum.com/t/html-option-in-form-for-errors/126100/2 "2008-01-15T13:09:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 15, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/html-option-in-form-for-errors/126100/3 "2008-01-15T13:20:18Z")

</div>

Thank you … again, frederick… now, I knows what stupid mistake  
I’ve made

On Jan 15, 2:08 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
