如何将其转换为 form_tag?这段代码基本上来自 Michael Hartl 的 RoR 教程第 8 章练习 1
<% provide(:title, "Sign in") %>
<h1>Sign in</h1>
<div class="row">
<div class="span6 offset3">
<%= form_for(:session, url: sessions_path) do |f| %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
<% end %>
<p>New user? <%= link_to "Sign up now!", signup_path %></p>
</div>
</div>
我尝试过这样的事情
<% provide(:title, "Sign in") %>
<h1>Sign in</h1>
<div class="row">
<div class="span6 offset3">
<% form_tag sessions_path, methods=> :post do %>
<%= label_tag 'email' %><br />
<%= text_field_tag :email, params[:email], :placeholder => "Email" %>
<%= label_tag 'password' %><br />
<%= password_field_tag :password %>
<%= submit_tag 'Sign in' %>
<% end -%>
<p>New user? <%= link_to "Sign up now!", signup_path %></p>
</div>
</div>
但它根本不显示表格。
谢谢