无法从 ckeditor gem 访问嵌套参数
cant access nested params from ckeditor gem
我正在尝试访问由 ckeditor gem 放入的嵌套参数。我似乎无法接近他们。我可以访问其他嵌套参数。
这是我的参数:
{"utf8"=>"✓",
"authenticity_token"=>"token==",
"task"=>
{"subject"=>"(Quote Requested) LT Quote",
"description"=>"For sample",
"problem_on"=>"2019 June 21",
"due_on"=>"2019 June 28",
"job_id"=>"121",
"lmi_host_id"=>"0",
"assigned_to_id"=>"104",
"priority"=>"Medium",
"task_class_id"=>"2"},
"task_template"=>{"title"=>""},
"note"=>{"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"},
"bill_hours"=>"0",
"bill_minutes"=>"0",
"nonbill_hours"=>"0",
"nonbill_minutes"=>"0",
"cat_type_id"=>"",
"activity"=>{"location_id"=>"", "location_modifier_id"=>"", "review"=>"0", "telecommute"=>"0"},
"commit"=>"Submit",
"id"=>"172330"}
我可以访问
params[:activity][:location_id]
and
params[:task][:subject]
as examples.
当我尝试访问
下的任何内容时
params[:note]
我没有返回。
params[:note]
returns 如下:
<ActionController::Parameters {"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"} permitted: true>
而且我需要找到一种方法来<p>test test<strong>setset<em>testste</em></strong></p>\r\n
摆脱参数
感谢您的帮助!
问题出在客户端
{"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"}
看起来很奇怪,因为这个键 "{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"
可以访问您需要的值!
我认为您需要检查客户端为什么它会那样发送
我正在尝试访问由 ckeditor gem 放入的嵌套参数。我似乎无法接近他们。我可以访问其他嵌套参数。
这是我的参数:
{"utf8"=>"✓",
"authenticity_token"=>"token==",
"task"=>
{"subject"=>"(Quote Requested) LT Quote",
"description"=>"For sample",
"problem_on"=>"2019 June 21",
"due_on"=>"2019 June 28",
"job_id"=>"121",
"lmi_host_id"=>"0",
"assigned_to_id"=>"104",
"priority"=>"Medium",
"task_class_id"=>"2"},
"task_template"=>{"title"=>""},
"note"=>{"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"},
"bill_hours"=>"0",
"bill_minutes"=>"0",
"nonbill_hours"=>"0",
"nonbill_minutes"=>"0",
"cat_type_id"=>"",
"activity"=>{"location_id"=>"", "location_modifier_id"=>"", "review"=>"0", "telecommute"=>"0"},
"commit"=>"Submit",
"id"=>"172330"}
我可以访问
params[:activity][:location_id] and params[:task][:subject] as examples.
当我尝试访问
下的任何内容时params[:note]
我没有返回。
params[:note]
returns 如下:
<ActionController::Parameters {"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"} permitted: true>
而且我需要找到一种方法来<p>test test<strong>setset<em>testste</em></strong></p>\r\n
摆脱参数
感谢您的帮助!
问题出在客户端
{"{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"=>"<p>test test<strong>setset<em>testste</em></strong></p>\r\n"}
看起来很奇怪,因为这个键 "{:class=>\"notes\", :ckeditor=>{:language=>\"us\"}}"
可以访问您需要的值!
我认为您需要检查客户端为什么它会那样发送