Forum: Ruby on Rails Newbie help ..

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.
B7cad399c3a8c73bc2ed4955a8ee2ed1?d=identicon&s=25 Mark Probert (Guest)
on 2006-02-07 01:09
(Received via mailing list)
Hi ..

I am new to Rails and it is not clear to me why I am getting the
following error.  Any help appreciated.

-m.


$cat app/views/admin/new.rhtml


<% @page_title = "New member..." -%>
<%= start_form_tag( :action => 'create' ) %>


<table>
   <tr>
     <td> First Name: </td>
     <td> <%= text_field( "member", "first_name", size => 40 %> </td>
   </tr>
   <tr>
     <td> Last Name: </td>
     <td> <%= text_field( "member", "last_name", size => 40 %> </td>
   </tr>
   <tr>
     <td> </td>
     <td> <%= submit_tag "Create" %> </td>
   </tr>

                       </table>

<%= link_to 'Back', :action => 'list' %>
<%= end_form_tag %>


In browser:

Showing app/views/admin/new.rhtml where line #8 raised:

compile error
script/../config/../app/views/admin/new.rhtml:8: parse error, unexpected
';', expecting ')'
_erbout.concat "    <td> "; _erbout.concat(( text_field( "member",
"first_name", size => 40 ).to_s); _erbout.concat " </td>\n"

                              ^
script/../config/../app/views/admin/new.rhtml:12: parse error,
unexpected ';', expecting ')'
_erbout.concat "    <td> "; _erbout.concat(( text_field( "member",
"last_name", size => 40 ).to_s); _erbout.concat " </td>\n"



--

-mark.

----------------------------------------------------
Mark Probert                 probertm at acm dot org
----------------------------------------------------


--

-mark.
B26c571d17b3022ab1a98c1a223c32e6?d=identicon&s=25 David Thomson (Guest)
on 2006-02-07 01:15
(Received via mailing list)
Looks to me like you've forgotten to close the parentheses and there's
a missing colon on the lines that call text_field, so:

      <td> <%= text_field( "member", "first_name", size => 40 %> </td>

should be:

      <td> <%= text_field( "member", "first_name", :size => 40 ) %>
</td>

Hope that helps,
David
E5665cfc97733b36ae0849b71576ff74?d=identicon&s=25 Ezra Nugroho (ezran)
on 2006-02-07 01:18
(Received via mailing list)
Hi,

I think you are missing a closing parentheses.

text_field( "member", "first_name", size => 40

should be

text_field( "member", "first_name", size => 40)


Good luck,
the other Ezra
B7cad399c3a8c73bc2ed4955a8ee2ed1?d=identicon&s=25 Mark Probert (Guest)
on 2006-02-07 01:24
(Received via mailing list)
Hi ..

David Thomson wrote:
> Looks to me like you've forgotten to close the parentheses ..

Doh!  My apologies for time wasting ...

-mark.
This topic is locked and can not be replied to.