简体   繁体   中英

ruby on rails ignores my form_tag

I have written in my index.html.erb the following lines

<% form_tag illnesses_path, :method =>'get' do %>
  <p>
     <%=  text_field_tag :search, params[:search] %>
     <%=  submit_tag "Search", :name => nil %>
  </p>
<% end %>

expecting that it will write a form element but rails completrly neglected those line.
when I wrote

 <p>
     <%=  text_field_tag :search, params[:search] %>
     <%=  submit_tag "Search", :name => nil %>
  </p>

the items apeared (but no form element). Why was the form element neglected

Change <% form_tag illnesses_path, :method =>'get' do %>

to

<%= form_tag illnesses_path, :method =>'get' do %> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM