【发布时间】:2011-06-01 10:41:26
【问题描述】:
我正在编写一个 ruby on rails 应用程序,但收到以下代码的编译错误
<%= form_tag(search_path, :method => "get") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>
这是来自 ruby on rails 表单指南的示例代码: http://guides.rubyonrails.org/form_helpers.html
产生的错误是,
编译错误 /Users/kmb89144/Desktop/Stoastic/app/views/application/index.html.erb:3:语法错误,意外')' ...h_path, :method => "get") 做).to_s); @output_buffer.concat ... ^ /Users/kmb89144/Desktop/Stoastic/app/views/application/index.html.erb:13:语法错误,意外的 kENSURE,期待 ')' /Users/kmb89144/Desktop/Stoastic/app/views/application/index.html.erb:15:语法错误,意外kEND,期待')'
提取的源代码(第 3 行附近):
1:
2:
3: "get") 做 %>
4:
5:
6:
有什么建议吗?
谢谢
【问题讨论】:
-
你有什么版本的 Rails?
标签: ruby-on-rails ruby forms