Forum: Ruby on Rails Problems with form_for

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Anton A. (Guest)
on 2007-02-07 23:18
(Received via mailing list)
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?
Bill S. (Guest)
on 2007-02-07 23:29
(Received via mailing list)
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
Keynan P. (Guest)
on 2007-02-07 23:30
could you post the full block of code please
Anton A. (Guest)
on 2007-02-07 23:43
(Received via mailing list)
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.
Kathy Van Stone (Guest)
on 2007-02-08 06:07
(Received via mailing list)
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
This topic is locked and can not be replied to.