I understand what is passed to the form_for
method when doing something like :
<% form_for(@user) do |f| %> ... <% end %>
if @user
is set in the controller. This is pretty obvious.
But what happens when we pass :user
, as I have seen in many examples ?
<% form_for(:user) do |f| %> ... <% end %>
When should I use the symbol version ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…