我注意到,每次将 Rails 表单发送到服务器时,提交按钮的名称(通常是按钮上显示的字符串)都会包含在params
散列为“提交”。
例如(最后一个条目)
{"utf8"=>"✓",
"authenticity_token"=>"eZABpBuW7afziDMUJtc1BNEKvGyI7NlTd9+NOYqnMxs=",
"order"=>{"name"=>"marco",
"email"=>"[email protected] /cdn-cgi/l/email-protection",
"phone"=>"0839457382",
"collection"=>"0",
"address"=>"18 main street, paarl",
"city"=>"paarl",
"country"=>"South Africa",
"zip"=>"7646",
"instructions"=>""},
"terms"=>"on",
"commit"=>"Next: 3. Payment"}
这样做的目的是什么?
这是因为我的表格格式不正确吗?
这是这个特定示例的提交按钮,取自我的form_for
block
<%= f.submit 'Next: 3. Payment', :class => 'right button' %>
(班级right button
来自基础 http://foundation.zurb.com/ forms.