Problems with form_for


#1

I’m working through examples to learn.

I’m trying
http://sl33p3r.free.fr/tutorials/rails/wiki/wiki-en.html
and extending it.
Right now I’m converting the form to ‘form_for’ and what ought to be
simple
is blowing up. However I hack it about I get the same message:

compile error
script/…/config/…/app/views/wiki/edit.rhtml:1: parse error, unexpected
‘)’
_erbout = ‘’; _erbout.concat(( form_for :topic do |f| ).to_s);
_erbout.concat “\n”
^
script/…/config/…/app/views/wiki/edit.rhtml:9: parse error, unexpected
kEND, expecting ‘)’

I’m baffled!


How come wrong numbers are never busy?


#2

It would help if you posted your rhtml … but hazarding a guess
here … make sure you use <% form_for … %> and not <%= form_for …
%>

-Bill
http://www.jadecove.com


#3

could you post the full block of code please


#4

That was it!

What a subtle difference from the

<%= form_tag

that I was editing!

DUH!

I’m glad you guys don’t roast idiotic mistakes

Bill S. said the following on 02/07/2007 04:27 PM:

It would help if you posted your rhtml … but hazarding a guess
here … make sure you use <% form_for … %> and not <%= form_for …
%>


This isn’t life in the fast lane, it’s life in the oncoming traffic.


#5

At 04:18 PM 2/7/2007, you wrote:

Right now I’m converting the form to ‘form_for’ and what ought to be simple
is blowing up. However I hack it about I get the same message:

compile error
script/…/config/…/app/views/wiki/edit.rhtml:1: parse error, unexpected ‘)’
_erbout = ‘’; _erbout.concat(( form_for :topic do |f| ).to_s);
_erbout.concat “\n”
^
script/…/config/…/app/views/wiki/edit.rhtml:9: parse error, unexpected
kEND, expecting ‘)’

This error means that you have <%= form_for :topic do |f| %> instead
of <% form_for :topic do |f| %>.
The unexpected ‘)’ error is usually a clue that you used <%= instead of
<%.

-Kathy Van Stone
removed_email_address@domain.invalid