2012-01-04 37 views
-3

我有问题:的SyntaxError在看#输入

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:9: syntax error, unexpected '=', expecting tASSOC 
...tag :action => 'at', :method = > post);@output_buffer.safe_... 
...        ^

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:12: syntax error, unexpected tSTRING_BEG, expecting ')'..._field_tag "text2", nil, :size" => 30);@output_buffer.safe_c... 
...        ^

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:15: syntax error, unexpected tIDENTIFIER, expecting ')' <input type="submit"/> 
         ^

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:15: unterminated string meets end of file 

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:15: syntax error, unexpected $end, expecting ')' 

提取的源(左右线#9):

6:  <h1>Les champs de saisie (champs de texte) version 2</h1> 
7:  Cette application Ruby on Rails lit du texte saisi. 
8:  <br> 
9:  <%= form_tag :action => 'at', :method = > post%> 
10:  Veuillez saisir votre nom. 
11:  <br> 
12:  <%= text_field_tag "text2", nil, :size" => 30%> 

回答

2

在代码中,9号线

:method = > post%>

应该是

:method => post%>

有一个不必要的空间。


和线路12

:size" => 30

应该

:size => 30

符号不报价结束。

相关问题