未定义的局部变量或方法' get'

时间:2012-01-06 22:27:34

标签: ruby-on-rails ruby linux

我拿出口音,我有这个错误

我运行RoR 3.2.0.rc1,Ruby 1.9.2并且我运行一个Ubuntu 11.10

  

显示/home/rene/ruby_dev/ch05/txt2fields/app/views/look/input.html第13行提出:

     

未定义的局部变量或方法`get'for#<#: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我用“get”更改“post”,我有同样的问题9

1 个答案:

答案 0 :(得分:2)

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

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

get被解释为变量名称,并且范围中不存在此类变量。因此错误。

相关问题