Добрый вечер, столкнулся с такой проблемой. На странице 2 POST-формы, обе генерируются через form_tag
<div class="col-md-4 col-md-offset-4 col-lg-4 col-lg-offset-4">
<!-- Nav tabs -->
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active"><a href="#login" aria-controls="login" role="pill" data-toggle="pill" class="nav-pill">Login</a></li>
<li role="presentation"><a href="#register" aria-controls="login" role="pill" data-toggle="pill" class="nav-pill">Register</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content top20">
<div role="tabpanel" class="tab-pane active" id="login">
<%= form_for "login/sign_in", method: "post", id: 'loginForm' do %>
<div class="form-group">
<%= label_tag :username, "Username" %>
<%= text_field_tag :log_username, nil, class: 'form-control', placeholder: 'Enter username' %>
</div>
<div class="form-group">
<%= label_tag :log_password, "Password" %>
<%= password_field_tag :log_password, nil, class: 'form-control', placeholder: 'Password' %>
</div>
<%= submit_tag "Sign in", class: "btn btn-black" %>
<% end %>
</div>
<div role="tabpanel" class="tab-pane" id="register">
<%= form_tag "login/sign_up", method: "post", id: 'registerForm' do %>
<div class="form-group">
<%= label_tag "data[username]", "Username" %>
<%= text_field_tag "data[username]", nil, class: 'form-control', placeholder: 'Enter username' %>
</div>
<div class="form-group">
<%= label_tag "data[password]", "Password" %>
<%= password_field_tag "data[password]", nil, class: 'form-control', placeholder: 'Password' %>
</div>
<div class="form-group">
<%= label_tag "data[blog_title]", "Blog title" %>
<%= text_field_tag "data[blog_title]", nil, class: 'form-control', placeholder: 'Blog title' %>
</div>
<%= submit_tag "Sign up", class: "btn btn-black" %>
<% end %>
</div>
</div>
</div>
но в результате у первой формы токен генерируется нормально:
<form accept-charset="UTF-8" action="login/sign_in" method="post">
<div style="display:none">
<input name="utf8" type="hidden" value="✓">
<input name="authenticity_token" type="hidden" value="arBY8Sf/5VsqeU2eqU8Cy9Ac2jnB9clmnCzgResOgiU=">
</div>
а у второй он почему-то пустой:
<form accept-charset="UTF-8" action="login/sign_up" method="post">
<div style="display:none">
<input name="utf8" type="hidden" value="">
<input name="authenticity_token" type="hidden" value="">
</div>
в чём проблема?
спасибо за ответ.