Form_for adds a div container with CSS style

Is it possible to remove the container div that creates the RoR?

Input:

<%= form_for @user, :as => :user, :url => user_sign_in_path(@user) do |f| %>
<p>

Output:

<form accept-charset="UTF-8" action="/user/sign_in" class="new_user" id="new_user" method="post">
    <div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="MT0OhRtfupZvi28m7bFN31JdZXyiFCGisbENml4cdcg=" /></div>
    <p>

<div style="margin:0;padding:0;display:inline">

I do not want it!

Is it normal that there are two hidden-text-inputs?

<input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="MT0OhRtfupZvi28m7bFN31JdZXyiFCGisbENml4cdcg=" />
+4
source share
1 answer

This is the default behavior form_for. Here is the official explanation:

HTML - : div . div , . utf8 , "GET" "POST". authenticity_token Rails, , GET ( , ).

.

+2

Source: https://habr.com/ru/post/1535755/


All Articles