# Problems with form\_for

**URL:** <https://www.ruby-forum.com/t/problems-with-form-for/84811>\
**Category:** Rails\
**Created:** [February 7, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811 "2007-02-07T22:18:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 7, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811/1 "2007-02-07T22:18:46Z")

</div>

I’m working through examples to learn.

I’m trying  
[http://sl33p3r.free.fr/tutorials/rails/wiki/wiki-en.html](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?

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 7, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811/2 "2007-02-07T22:29:46Z")

</div>

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

-Bill

> **[Jade Cove Partners](https://www.jadecove.com/)**

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 7, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811/3 "2007-02-07T22:30:52Z")

</div>

could you post the full block of code please

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 7, 2007, 10:43pm UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811/4 "2007-02-07T22:43:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![antonaylward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@antonaylward](https://www.ruby-forum.com/u/antonaylward)\
**Post date:** [February 8, 2007, 5:07am UTC](https://www.ruby-forum.com/t/problems-with-form-for/84811/5 "2007-02-08T05:07:20Z")

</div>

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
