這是我_search_box.html.erb
文件爲什麼我會得到錯誤的參數數目(1 2)的form_tag
<%= form_tag "/search", :method => "get" do %>
<%= text_field :q %>
<%= submit_tag 'Search' %>
<% end %>
這是在search.html.erb
呈現:
<% if @products %>
<%= render(:partial => "products") %>
<% end %>
但是,我在_search_box.html.erb
第2行發生錯誤:
Showing /****/app/views/catalog/_search_box.html.erb where line #2 raised:
wrong number of arguments (1 for 2)
Extracted source (around line #2):
1: <%= form_tag "/search", :method => "get" do %>
2: <%= text_field :q %>
3: <%= submit_tag 'Search' %>
4: <% end %>
Waht錯了嗎?