我在节目中设置了一个会话 var :time_block_id。提交表单后,您会看到相同的 session_id 和 _csrf_token 但 :time_block_id 消失了。有任何想法吗?导轨 3.2.6
控制器.rb
def show
session[:time_block_id] = "test"
debugger
(rdb:663) p session
# outputs ...
{"session_id"=>"1232115b1ffe78b7e71163e4bd48974a", "user_return_to"=>"/app/admin/clients", "_csrf_token"=>"/aFAp07yrpQtjgXDS2HQk+uNZLD3QuGRzSGX4Mszyug=", "warden.user.user.key"=>["User", [2], "$2a$10$1Mn/Riq9WdmnUUUiVhXbsO"], "time_block_id"=>"test"}
render_wizard
end
def update
debugger
(rdb:663) p session
{"session_id"=>"1232115b1ffe78b7e71163e4bd48974a", "user_return_to"=>"/app/admin/clients", "_csrf_token"=>"/aFAp07yrpQtjgXDS2HQk+uNZLD3QuGRzSGX4Mszyug=", "warden.user.user.key"=>["User", [2], "$2a$10$1Mn/Riq9WdmnUUUiVhXbsO"]}
a = ""
end
_form.html.haml
=simple_form_for @time_block, url: wizard_path, :method => :put do |f|
=f.submit "go"