gpt4 book ai didi

ruby-on-rails - Ruby on Rails 中 Look#input 中的语法错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:34:42 34 4
gpt4 key购买 nike

我是 RoR 的新手,我使用“Débuter avec Ruby on Rails”进行测试。它是 Steven Holzner 的“Beginning 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  <=

问题是什么?

最佳答案

尝试

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

和你的文本字段

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

关于ruby-on-rails - Ruby on Rails 中 Look#input 中的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8719449/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com