문제

I have written this code:

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

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

The problem I am facing is that submit tag is replacing the text_field tag, i.e. only submit tag appears, i want both of them to appear. What is wrong with code?

Regards

도움이 되었습니까?

해결책

Try this:

<%= form_tag({:action => "simple_search", :method => 'get'}) do %>
  <%= text_field_tag(:searchTextField, "Search by first name") %>
  <%= submit_tag "Search", class: "edit_button" %>
<% end %>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top