Problems with form_for

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!

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

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 Siggelkow said the following on 02/07/2007 04:27 PM:

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
kvs@pobox.com