我已经使用gem'trix'将trix编辑器功能集成到rails应用程序中。
但是,在暂存环境中进行测试时,trix_editor内容字段显示图像的相对路径。
let task = URLSession.shared.dataTask(with: url) { (data, response , error) in
guard let error = error else { print(error); return }
do {
let decoder = JSONDecoder()
let dataList = try decoder.decode(JSONData.self, from: data!) {
self.state = dataList.Success
self.dept_code = dataList.Payload.dept_code
self.dept_name = dataList.Payload.dept_name
self.ename = dataList.Payload.ename
self.name = dataList.Payload.name
self.sys_order = dataList.Payload.sys_order
self.sys_it = dataList.Payload.sys_it
self.sys_card = dataList.Payload.sys_card
if self.state == true {
DispatchQueue.main.async {
self.performSegue(withIdentifier: "loginS", sender: self)
}
}
} catch {
print(error)
}
}
task.resume()
有没有一种方法可以使用image_url或类似的东西为trix_editor内容字段中的图像定义图像的绝对路径,如
<img src="/images/2036780.jpg" style="height: 400px; width: 600px;">