2012-01-06 103 views
-1

我拿出口音和我有这个错误未定义的局部变量或方法“获得”

我跑回报率3.2.0.rc1,红宝石1.9.2和我的工作一个Ubuntu的11.10

表示在线路#13升高/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html:

未定义局部变量或方法`得到”为#<#:0x9557f04>

提取源(第13行附近):

10:    <br> 
11:    Elle transmet la variable au modele. 
12:    <br> 
13:    <%= text_form_tag :action => 'at', :method => get %> 
14:    Votre nom. 
15:    <br> 
16:    <%= text_field_tag 'text1', nil, :size => 30 %> 

PS我改“后”与“得”和我有相同的problem9

+0

IMO如果答案有效,应该接受。 – 2012-01-07 02:27:40

回答

2

你应该在这里使用一个符号。

<%= text_form_tag :action => 'at', :method => :get %> 
              ^
               | this is important 

get被解释为一个变量名称,并且该范围中不存在这样的变量。因此错误。

+0

我把帖子代替获得和我有同样的错误? – 2012-01-07 01:50:59

+0

注意':get'前面的冒号? – 2012-01-07 01:52:05

+0

好的,谢谢你的支持;) – 2012-01-07 02:04:48