2012-01-04 36 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

符號不報價結束。

相關問題