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|
%>
<p>
<b>Comment body</b><br />
<%= f.text_area :desc %>
</p>
<p><label
for="comment_image">Image</label><br/>
<%= file_column_field ''comment'',
''image'' %></p>
<p>
<%= f.submit button_name %>
</p>
<% 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
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| > %> > <p> > <b>Comment body</b><br /> > <%= f.text_area :desc %> > </p> > <p><label for="comment_image">Image</label><br/> > <%= file_column_field ''comment'', ''image'' %></p> > <p> > <%= f.submit button_name %> > </p> > <% 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 > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
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| > > %> > > <p> > > <b>Comment body</b><br /> > > <%= f.text_area :desc %> > > </p> > > <p><label for="comment_image">Image</label><br/> > > <%= file_column_field ''comment'', ''image'' %></p> > > <p> > > <%= f.submit button_name %> > > </p> > > <% 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--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---