Ruby on Rails中Look#输入中的SyntaxError

时间:2012-01-03 22:18:51

标签: ruby-on-rails ruby linux ubuntu-11.04

我是RoR的新手,我使用“DébuteraveveRuby on Rails”进行测试。 Steven Holzner用法语“开启Ruby on Rails”。我在Look#input中有SyntaxError:

Showing /home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html where line #9 raised:

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:9: syntax error, unexpected ',', expecting ')'
...rt_form_tag ({:action => "at"}, {:method = > "post"} ));@out...
...                               ^

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:9: syntax error, unexpected '}', expecting ')'
... => "at"}, {:method = > "post"} ));@output_buffer.safe_conca...
...                               ^

/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:12: syntax error, unexpected ',', expecting ')'
...end= ( text_field_tag ("text2", "", ["size" => 30]) );@outpu...
...                               ^

提取的来源(第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:     <%= start_form_tag ({:action => "at"}, {:method = > "post"} )%>
10:       Veuillez saisir votre nom.
11:       <br>
12:       <%= text_field_tag ("text2", "", ["size" => 30]) %>

包含模板的痕迹:

app/views/look/input.html  <=

有什么问题?

1 个答案:

答案 0 :(得分:1)

form_tag :action => 'at', :method => post

和您的文字字段

text_field_tag "text2", nil, :size => 30