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. ---------------------------------------------------- Mark Probert probertm at acm dot org ----------------------------------------------------
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 On 07/02/06, Mark Probert <probertm@gmail.com> wrote:> > 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. > > ---------------------------------------------------- > Mark Probert probertm at acm dot org > ---------------------------------------------------- > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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 On Mon, 2006-02-06 at 16:07 -0800, Mark Probert wrote:> 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 > ---------------------------------------------------- > >