这是一个使用CKeditor的简单导轨形式。我的模型只保存了一些信息
我正在保存内容,它出现在更新中。
pp params[:email]["body"]
"<br />\r\nheyyy<br />\r\nbut now i am going to save this past 9 lines.<br />\r\ncuz that's what this is all about<br />\r\n<br />\r\nI am crazy like that<br />\r\nc<br />\r\ncrazy<br />\r\ncrazy c<br />\r\ncrazy<br />\r\n<br />\r\nhere is another line..<br />\r\[email protected]!!&<br />\r\nfa<br />\r\nsdf<br />\r\nas<br />\r\ndf<br />\r\nasd<br />\r\nfa<br />\r\nsdfasdf<br />\r\n"
然后我的控制器是这样的:
@emails = Email.find(params[:id])
呢!在调用这个之后,我在ruby-debug中输入@emails.body
,并输出1/2! :
@emails.body
"<br />\r\nheyyy<br />\r\nbut now i am going to save this past 9 lines.<br />\r\ncuz that's what this is all about<br />\r\n<br />\r\nI am crazy like that<br />\r\nc<br />\r\ncrazy<br />\r\ncrazy c<br />\r\ncrazy<br />\r\n<br />\r\nhere is another line..<br />\r\[email protected]!!&"
为什么会出现这种情况?
该属性被保存为我的数据库中的字符串。