0

我写了这段代码:

     <%=
        form_tag({:action => "simple_search", :method => 'get'}) do
    text_field_tag(:searchTextField, "Search by first name")

    submit_tag "Search", class: "edit_button"
        end
     %>

我面临的问题是提交标签正在替换 text_field 标签,即只出现提交标签,我希望它们都出现。代码有什么问题?

问候

4

1 回答 1

0

尝试这个:

<%= form_tag({:action => "simple_search", :method => 'get'}) do %>
  <%= text_field_tag(:searchTextField, "Search by first name") %>
  <%= submit_tag "Search", class: "edit_button" %>
<% end %>
于 2013-10-23T17:46:18.137 回答